Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding ID of ASP.NET grid controls
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00758496
Message ID:
00758583
Views:
17
I think my question is more basic than that. In your article at usingaspnetwithvfp7.asp I see the following code:
      // Assign the objects to each object in the edited row.
      objCompanyCtrl = (TextBox)objArgs.Item.FindControl("txtCompany");
      objContactCtrl = (TextBox)objArgs.Item.FindControl("txtContact");
      objCustIDCtrl = (Label)objArgs.Item.FindControl("lblCustID");
I have setup my own datagrid and have no idea what the controls are called within it. Where did you assign "txtCompany", etc. to the datagrid? I have looked at the design properties and the ASP/HTML code and can't see where to assign ID's to the columns so I know what to put in the findcontrol() method. Probably just amazingly simple, but I can't find it.



>Hi Steve,
>
>Check out message #745148 to see how I use the FindControl method to add javascript to a column in the DataGrid. This should provide you with the syntax of how to access the information you need to get at. Hope this helps.
>
>>I have an ASP.NET web datagrid setup to edit some data. I'm trying to setup a save function which needs to reference the text controls in the row. I've tried to use the findcontrol() method, but I cannot find ANYWHERE anything that tells me the name of the column controls. So far my guesses of the datasource and header caption are incorrect.
>>
>>In vfp it would be as simple as grid.column, but I can see no way to do that in ASP.NET.
>>
>>TIA~
Steve Howie, owner
DaSH Technology
Denver, CO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform