The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I wanted to extract a cell value under a specific column for a selected row in sfDataGrid. One solution I found in a separate question but that is still confusing to me. However, I was simply tinkering with the code and found that there could be a shorter way to do that. For me, I just aim to get cell value for a selected row inside sfDataGrid, for which I used the following code:
DataRowView record = (DataRowView)DG_CblLib.View.Records.GetItemAt(DG_CblLib.SelectedIndex);
var cv = record.Row.ItemArray[DG_CblLib.TableControl.ResolveToGridVisibleColumnIndex(2)];
The code is working fine for me but just wanted to ask if there could be any situation where this code might fail to retrieve a cell value or may be any exception get raised for some unhandled error prone code that I forgot to pay attention to.
VSVijayarasan Sivanandham Syncfusion Team December 28, 2020 12:05 PM UTC
Hi Shankul Gupta,
Thank you for contacting Syncfusion support.
Based on provided information you can get the cell value properly using above mentioned forum by without making any error in sfDataGrid. In some other way to get the cell value in SfDataGrid mentioned in below UG link for your reference,