HowTo: retrieve a datarow in the dataGrid update handler

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

How can I retrieve a DataRow from the DataGrid in the update handler?
Can I do this or do I need to construct one?
 
Alex said:
How can I retrieve a DataRow from the DataGrid in the update handler?
Can I do this or do I need to construct one?

Alex, what you do is grab the value in the DataGrid. How you get the
value for a particular column of the updated row depends on if the row
is a BoundColumn or a TemplateColumn. Examples for both types of
columns can be seen here:

http://datawebcontrols.com/faqs/ProgrammaticAccess/AccessingBoundColumnContents.shtml
http://datawebcontrols.com/faqs/ProgrammaticAccess/AccessingTemplateColumnContents.shtml

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
If your datagrid is bound to a datatable, use e.item.datasetindex to get the
row index, then retrieve the data from that row in the datatable.
 
Is there a way to directly get an entire DataRow out of the grid?

e.g. DataRow x = ???DataGrid??? [e.Item.DataSetIndex]
 
Back
Top