Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] {},
new object[] {},
new object[] {}
};
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel
runat="server"
Width="300"
Height="200">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:ComponentColumn runat="server" Flex="1" Text="Name">
<Component>
<ext:Container runat="server" Layout="HBoxLayout">
<Items>
<ext:TextField runat="server" Flex="1">
<Listeners>
<Focus Handler="this.ownerCt.getComponent('AddButton').show();" />
<Blur Handler="this.ownerCt.getComponent('AddButton').hide();" />
</Listeners>
</ext:TextField>
<ext:Button
runat="server"
ItemID="AddButton"
Width="22"
Icon="Add"
Hidden="true" />
</Items>
</ext:Container>
</Component>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>
By the way, there is a TextField's RightButtons collection which you might want to use instead. Here is an example.