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

How to get the cell value of specific row and column??

You can get the cell value of specific row and column in SfDataGrid 


5 Replies

MK Muthukumar Kalyanasundaram Syncfusion Team June 9, 2017 07:09 AM UTC

Hi Luis, 

Thank you for contacting Syncfusion support. 

We have analyzed your query, You can achieve your requirement by using propertyCollection.GetValue() method as shown like below code, 
 
Code Snippet: 
 
// to get the record of specific row index. 
var rowData = dataGrid.GetRecordAtRowIndex(4); 
var propertyCollection = this.dataGrid.View.GetPropertyAccessProvider(); 
//to get the cellvalue of specific row and column  
var cellValue = propertyCollection.GetValue(rowData, "EmployeeName"); 



Could you please refer the below KB link, to get the information of selected cell in SfDataGrid.  
  
  
Please let us know if you have any query.  
  
Regards,  
Muthukumar K 


SI Simson September 20, 2019 07:51 AM UTC

I got error while trying to execured below code

var rowData = dataGrid.GetRecordAtRowIndex(4); 
var propertyCollection = this.dataGrid.View.GetPropertyAccessProvider(); 
var cellValue = propertyCollection.GetValue(rowData, "EmployeeName"); 

Error:

System.InvalidCastException: 'Unable to cast object of type 
'Syncfusion.Data.RecordEntry' to type 'ZimFish.pd_select_withonepmResult'.'



SS Susmitha Sundar Syncfusion Team September 23, 2019 01:23 PM UTC

Hi Simson, 
 
Thanks for your update. 
 
Based on the provided information, we have checked the mentioned issue and we unable to replicate the issue from our end, this code working fine as expected. Please refer the below sample, 
 
 
Please check the above sample and revert us if you still facing the same issue? If yes, please modify the sample based on your scenario and revert us back with the following details, 
 
·       Issue reproducing video (if possible) 
·       Syncfusion update version 
 
It will be helpful for us to check on it and provide you the solution at the earliest.     
 
Regards,
Susmitha S 



AH Ahmed HADJ MOHAMMED November 29, 2021 08:42 PM UTC

Hi, i'm using this

 

var record = datagrid.View.GetRecordAt(selectedIndex);

var propertyCollection = datagrid .View.GetPropertyAccessProvider();

var cellvalue = propertyCollection.GetValue(record.Data, "TODO_YourPropertyName") + "";




VS Vijayarasan Sivanandham Syncfusion Team November 30, 2021 05:52 AM UTC

Hi Ahmed HADJ MOHAMMED,

Thanks for your suggestion.

Regards,
Vijayarasan S


Loader.
Up arrow icon