A Alex Apr 26, 2004 #1 How can I retrieve a DataRow from the DataGrid in the update handler? Can I do this or do I need to construct one?
How can I retrieve a DataRow from the DataGrid in the update handler? Can I do this or do I need to construct one?
S Scott Mitchell [MVP] Apr 26, 2004 #2 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? Click to expand... 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!
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? Click to expand... 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!
R Rick Spiewak Apr 26, 2004 #3 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.
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.
A Alex Apr 26, 2004 #4 Is there a way to directly get an entire DataRow out of the grid? e.g. DataRow x = ???DataGrid??? [e.Item.DataSetIndex]
Is there a way to directly get an entire DataRow out of the grid? e.g. DataRow x = ???DataGrid??? [e.Item.DataSetIndex]