G
Guest
How do I find the index number of a row inorder to update it?
Thanks, Justin.
Thanks, Justin.
Justin said:How do I find the index number of a row inorder to update it?
Mark Rae said:Justin said:How do I find the index number of a row inorder to update it?
If you're talking about the <aspataGrid> control, when you switch it into
Edit mode the row that you're currently editing is available through the
Item property of the DataGridCommandEventArgs parameter of the Edit method.
You can refer to each of the columns in that row by the Item property's
Cells collection. E.g. if you stored the dataset's primary key as a hidden
column in the datagrid, you could access it like this (for C#):
public void dgrd<DataGridName>_Edit(object sender, DataGridCommandEventArgs
e)
{
int intPrimaryKey = Convert.ToInt32(e.Item.Cells[0].Text);
}
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.