text box in Grid View footer row not giving correct text.

Anglefroghammer

New member
Joined
Jul 15, 2010
Messages
2
Programming Experience
5-10
Hi Guys,

I am having a problem getting some text from a textbox inside the footerrow of a gridview if it is changed. I can get the actual text box using
VB.NET:
gridview1.footerrow.findcontrol("control name")
but it gives me whatever value it was set to on load and not the changed text.

Here is my asp code.

VB.NET:
        <asp:GridView ID="GridView1" runat="server" ShowFooter="True" AutoGenerateColumns="False">
            <Columns>
                <asp:TemplateField HeaderText="Col1">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DESC") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("DESC") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:DropDownList runat="server" ID="ChargeTypes" Width="100%">
                        </asp:DropDownList>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Col2">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("StartDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("StartDate") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Col3">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("RetirementDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("RetirementDate") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text="test"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <FooterTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Add Row"
                            Text="Add"></asp:LinkButton></FooterTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </h2>
</asp:Content>

Any help would be great
 
Back
Top