GridView vs. DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What's the equivalent in GridView of the DataGrid e.Item.Cells(2).Text (where
e is DataGridCommandEventArgs)?

Thanks much
 
There isn't a direct equivalent. You actually have to do some work to get a
match. In the GridView, you have the RowCommand which is based on the
GridViewCommandEventArgs. The one big difference is that the event handler
is not aware of the actual row that it was triggered from, so you need to
use the CommandArgument property as a means to capture your RowIndex value,
generally by using the RowCreated event.

Note that there are several events that could be used for generic row
handling. Look at the MSDN SDK documentation for more information.
 

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

Back
Top