Advertisement

04.04.2008 at 10:06AM PDT, ID: 23296680 | Points: 500
[x]
Attachment Details

Trying to access controls in GridView on RowUpdating event

Asked by AFAIT in Programming for ASP.NET, WebApplications

Tags: asp.net

So i am trying to use a data grid for displaying / updating information.  However some of the fields are going to be combo boxes where they will choose their items.  Because of this as i understand on the RowEditing event i will have to select the value and on the RowUpdating i will manually update my table and just do a post back for refresh.  However when i try to use the

CType(gvResults.FindControl("txtIfatOther"), TextBox).Text

where txtIfatOther is the name of my text box it keeps giving me nullreferenceexception.

I have looked at several examples out there and nothing really seems to be guiding me towards the light.  So if anyone knows of how to reference a control in in a datagrid i would love to hear how it is done.

Also not sure if it makes a difference but here is how my gridview column is set up

                           <asp:TemplateField HeaderText="IFAT Other" >
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtIfatOther" runat="server" MaxLength="100" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblIfatOther" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>

Start Free Trial
[+][-]04.04.2008 at 10:21AM PDT, ID: 21283805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 10:29AM PDT, ID: 21283887

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 10:31AM PDT, ID: 21283906

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 10:45AM PDT, ID: 21284028

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 10:49AM PDT, ID: 21284073

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 10:56AM PDT, ID: 21284153

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 11:42AM PDT, ID: 21284539

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.04.2008 at 12:11PM PDT, ID: 21284773

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 09:43AM PDT, ID: 21351474

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.14.2008 at 09:50AM PDT, ID: 21351528

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628