Row data in DataGridRowAdapter

How we get get  the value of  a DataGridCell  OR the data row  of the GridSource?
Can we have in the GridSource other data (from the same data record) which we don't want to display them in the sfDataGrid?


2 Replies

ST Stefan Tsalapatis February 3, 2022 08:54 PM UTC

In the DataGridRowAdapter from another cell onPressed event,  we can find another underline data object's property value
writing for example

String appId = row.getCells().firstWhereOrNull((element) => element.columnName =="AppId")?.value;


But we need to add the GridCell in the GridSource's collection  and in the Grid Columns as first Column with visible: false.     
Is there any other way, more simpler,  to access the data object  referenced from the DataGridSource ?



TP Tamilarasan Paranthaman Syncfusion Team February 4, 2022 03:49 PM UTC

Hi Stefan Tsalapatis, 
We suspect that you need to have the AppId value in the GridSource without adding GridCell, also without setting an AppId Grid Column visible property as false.  The Datagrid mapped the cell values only based on the given columns and cells, so GridSource didn't have any other data. 
If we misunderstood, please provide more details about your requirements, it will help us to provide the solution as early as possible. 
Regards, 
Tamilarasan 
  
  


Loader.
Up arrow icon