Control Index



A Form has only a DataGrid control. Using EditCommandColumn in the
DataGrid, when a row is in the editable mode i.e. the BoundColumns get
replaced by TextBoxes, the Text in the TextBox existing in the first
cell can be accessed in the, say, UpdateCommand event handler of the
DataGrid using


Similalrly, the Text in the TextBox existing in the third column can be
accessed using


so on & so forth. If I am not wrong, Controls(0) here refers to the
DataGrid control. The control index of the DataGrid here is 0 since
there are no other controls in the page (please correct me if I am
wrong). But how do I find out what is the control index of the DataGrid
if there are multiple controls in an ASPX page or/and controls are
being added dynamically to the page?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads