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

Get value of hidden cell of selected row

Hello Sir,

I am trying to get value of hidden cell of selected row.

I am using below code from an example online, but it exits with error on last row.

//--------------------------
      // Get the cell value for RowIndex = 5 and ColumnIndex = 1 
            int rowIndex = 5;
            int columnIndex = sfDataGrid.TableControl.ResolveToGridVisibleColumnIndex(1);
            if (columnIndex < 0)
                return;
            var mappingName = sfDataGrid.Columns[columnIndex].MappingName;
            var recordIndex = sfDataGrid.TableControl.ResolveToRecordIndex(rowIndex);
            if (recordIndex < 0)
                return;
            
                var record1 = sfDataGrid.View.Records.GetItemAt(recordIndex);
                var cellVaue = (record1.GetType().GetProperty(mappingName).GetValue(record1, null).ToString());
            
//--------------------------

I want to get cell value on double click or cell double click event.

Please help, where something is wrong.

Your help will be highly appreciated.


1 Reply

SA Saravanan Ayyanar Syncfusion Team January 13, 2020 01:26 PM UTC

Hi Balbir, 
 
Thank you for using Syncfusion controls. 
 
We have checked your provided code snippet, it works fine as expected from our end. We have prepared sample, to get the hidden cell value on cell double click event. Please find the below sample and UG link. 
 
Sample Link: 
 
UG Link: 
 
Please let us know, if you require further assistance on this. 
 
Regards, 
Saravanan A. 


Loader.
Live Chat Icon For mobile
Up arrow icon