We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

griddataboundgrid cell data

Hi, Is there any way to get new cell value from griddatabound grid after shorting the data in one the column. I need to get the cell value after shorting the data in the column. MALLIK

3 Replies

AD Administrator Syncfusion Team May 3, 2005 11:55 AM UTC

Exactly how are you trying to look up the data in a sorted grid? Do you know a grid rowindex and grid column index? If so, you can use: object val = this.grid[rowIndex, colIndex].CellValue; to retreive a value from a specific row and column whether or not the grid has been sorted. Do you want to try to retrieve a specific DataRow from the underlying DataTable given that you know a rowindex in a sorted grid? If so, you can use the CurrencyManager to retrieve the DataRow. CurrencyManager cm = this.grid.BindingCOntext[this.grid.DataSource, this.grid.DataMember] as CurrencyManager; DataView dv = cm.List as DataView; int position = this.grid.Binder.RowIndexToPosition(grivenRowIndex); DataRow dr = dv[position].Row;


AD Administrator Syncfusion Team May 3, 2005 04:04 PM UTC

HI, I loaded data into GridDataBoundGrid from a datatable. After that I sorted the GridDataBoundGrid data based on any one of the column data. Then I need to get all rows of data in the sorting order. I try to get data after sorting using DataView, but the data in the rows are same as like data without sorting order. Here i am using the Row Index same as before sorting. Can you give some sample code for this. Mallik >Hi, > >Is there any way to get new cell value from griddatabound grid after shorting the data in one the column. >I need to get the cell value after shorting the data in the column. > >MALLIK >


AD Administrator Syncfusion Team May 3, 2005 04:34 PM UTC

>>I try to get data after sorting using DataView, Do you get the DataView using the code I posted above? Here is a little sample with 2 buttons that output the data in the grid in grid order whether or not it is sorted. One button uses the currencymanager and the other just loops through the grid. http://www.syncfusion.com/Support/user/uploads/GDBG_Sorted_6fb3f071.zip

Loader.
Live Chat Icon For mobile
Up arrow icon