Rank: Advanced Member Groups: Member
Joined: 8/26/2021 Posts: 47
|
Is there built-in way to achieve: after populating the grid, the first item (if any) is automatically selected? Currently, we need to, after each data binding, test if the grid contains any items, and then set SelectedItemIndex=0, accordingly.
Hope in the future build, there is a built-in property that , when set, can achieve it.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Yes. Setting SelectedItemIndex is the right way to achieve this.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 8/26/2021 Posts: 47
|
Thanks for reply. In our project, there is hundreds of eo.grid used. We hope not to scatter around such code ("if grid.items.length>0 then grid.selectedindex=0") here and there. And if eo.grid can handle it, then we don't re-invent the wheel everywhere.
|