syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Display indexes for rows in sfDataGrid

VladTheJunior opened this issue · comments

Use case

Missing feature to allow display row indexes like in Excel.

Proposal

Indexes display numbers from 1 to visible rows count. Clicking on index select entire row. Indexes do not depends on sorting and filter
Example:
image

If for example row 4 is not visible (by filter for example) row 5 should became 4, row 6 became 5 and so on.
If rows are filtered by columns, indexes still should display number from 1 to visible rows count

Hi @VladTheJunior ,

You can achieve the display of indexes ranging from 1 to the visible row count by generating a separate column as the first one to show the count of rows, as you mentioned. Within the buildRow method, you can add the respective index to the first column by utilizing the effective rows collection. Obtaining the index from the effective rows ensures that it ranges from 1 to the visible row count, even when filtering or sorting occurs.

We have attached a sample for your reference. Please consult the following sample for further information.

Regards,
Abinesh P