|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
I would like to read data from datagrid.
How can I read one cell from datagrid (raw, column). How can I find out total numbers of raws. Thanks for help, Simon Simon Abolnar wrote:
> I would like to read data from datagrid. By "raw" I assume you mean "row"...> How can I read one cell from datagrid (raw, column). > > How can I find out total numbers of raws. You can determine the total number of rows using the following property: DataGridID.Items.Count You can access a particular cell of the DataGrid using the following code: 'VB.NET Dim cell as TableCell = DataGridID.Items(rowIndex).Cells(colIndex) // C# TableCell cell = DataGridID.Items[rowIndex].Cells[colIndex]; Once you have the TableCell instance you can read the text contents via the .Text property. (If it's a TemplateColumn you will need to work through the control hierarchy... see the following two FAQs for how to programmatically work with the contents of BoundColumns and TemplateColumns: http://datawebcontrols.com/faqs/ProgrammaticAccess/AccessingBoundColumnContents.shtml http://datawebcontrols.com/faqs/ProgrammaticAccess/AccessingTemplateColumnContents.shtml hth
Paging with Datagrid Control
Change/read value from control in EditItemTemplate how can I get the DataKeyField read row values from datagrid and populate in new datagrid values from connected MessageBox not showing before Response.Redirect ItemDataBound Slow datagrid on postback Datagrid column formatting button column how to use hyper columns in datagrid |
|||||||||||||||||||||||