BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Vasanth,
Thank you for using Syncfusion products.
We have analyzed your query. You can achieve your requirement like getting the row data from DisplayElements in grouping case by using the corresponding resolved record index.
Code Snippet [C#]:
void datagrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs args) { if (args.Column.MappingName.Equals("EmployeeName")) { var recordIndex = datagrid.ResolveToRecordIndex(args.RowColumnIndex.RowIndex);
if (this.datagrid.View.TopLevelGroup != null) { // Get the current row record while grouping var record = this.datagrid.View.TopLevelGroup.DisplayElements[recordIndex]; // data of record as type cast to OrderInfo var rowData = (record as RecordEntry).Data as BusinessObjects; if (rowData.EmployeeName == "Mart") args.Cancel = true; } else { // Get the current row record var record1 = this.datagrid.View.Records.GetItemAt(recordIndex);
if ((record1 as BusinessObjects).EmployeeName == "Mart") args.Cancel = true; } } } |
We have also prepared the sample based on this and please find the sample under the following location,
Sample: http://www.syncfusion.com/downloads/support/directtrac/141139/ze/SfDataGridDemo227932121
KB Link:
http://www.syncfusion.com/kb/2446/how-to-get-the-current-cell-value-when-you-click-the-cell
Please let us know if you need further assistance.
Thank you,
Jai Ganesh S