A
Arulraja
Hello,
I have the following code in the .aspx file
<asp:TemplateColumn HeaderText=" FG Name">
<HeaderStyle ForeColor="White"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Width="200px"></ItemStyle>
<ItemTemplate>
<asp:TextBox id=txt_fg Width="200px" Runat="server" Text='<%#
DataBinder.Eval(Container,"DataItem.family_group_name")%>'
MaxLength="100" />
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="footerfg" Width="200px" runat="server" />
</FooterTemplate>
</asp:TemplateColumn>
In the code behind button click event i have the follwing code
foreach (DataGridItem item in grid_1.Items)
{
// get values from UI
TextBox txtf = (TextBox)item.Cells[1].FindControl("txt_fg");
}
But this one is giving me only the DataGridItems(Items and
ALternativeItems) not the Footer Items. If I pass the Footer TextBox
ID to the FindControl method it return's a null.
If I try the same code in the ItemCreated Event the TextBox "TEXT"
property return's empty string.
Can somebody help me to fix this problem? or Direct me how to access
the Footer TextBox value on the Button Click event.
Thx
Arul
I have the following code in the .aspx file
<asp:TemplateColumn HeaderText=" FG Name">
<HeaderStyle ForeColor="White"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Width="200px"></ItemStyle>
<ItemTemplate>
<asp:TextBox id=txt_fg Width="200px" Runat="server" Text='<%#
DataBinder.Eval(Container,"DataItem.family_group_name")%>'
MaxLength="100" />
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="footerfg" Width="200px" runat="server" />
</FooterTemplate>
</asp:TemplateColumn>
In the code behind button click event i have the follwing code
foreach (DataGridItem item in grid_1.Items)
{
// get values from UI
TextBox txtf = (TextBox)item.Cells[1].FindControl("txt_fg");
}
But this one is giving me only the DataGridItems(Items and
ALternativeItems) not the Footer Items. If I pass the Footer TextBox
ID to the FindControl method it return's a null.
If I try the same code in the ItemCreated Event the TextBox "TEXT"
property return's empty string.
Can somebody help me to fix this problem? or Direct me how to access
the Footer TextBox value on the Button Click event.
Thx
Arul