Closed MalikSamiAwan closed 1 month ago
Hi @MalikSamiAwan ,
It seems you are trying to add background color to rows based on the tapped row index. When performing sorting or filtering, you can use DataGridSource.effectiveRows to retrieve the row index. This method returns a copy of DataGridSource.rows, which contains the sorted or filtered collection if sorting or filtering is applied in the DataGrid. Use this property to get the corresponding visible row index for customizations such as setting alternate row colors, changing row colors based on the row index, and more. We have included a sample for your reference. Please review it for further details.
Regards, Abinesh P
Thanks it worked
so if we apply sorting to any of columns and than highlight does not reflect rows located in table as in demo you can see i am clicking on row 1 and its highlighting row 5
DataGridRowAdapter( color: currentRowIndex==highlightRowIndex?highlightRowColor:Colors.transparent, )
https://github.com/user-attachments/assets/107ac49b-4e0a-4164-98af-a27d8ee2e77b