How to get the cell value of specific row and column??
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");
|
Sample: http://www.syncfusion.com/downloads/support/forum/130896/ze/SfDataGridDemo_GetCellValue-1085879253
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,
Sample link: https://www.syncfusion.com/downloads/support/forum/130896/ze/SfDataGridDemo_GetCellValue835202776
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
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
Thanks for your suggestion.
Regards,
Vijayarasan S
SIGN IN To post a reply.
- 5 Replies
- 6 Participants
-
LF Luis Fernando Gomez
- Jun 8, 2017 08:28 PM UTC
- Nov 30, 2021 05:52 AM UTC