Welcome Guest Search | Active Topics | Sign In | Register

eo.web grid auto-select first item... Options
grchen168
Posted: Friday, November 10, 2023 4:57:39 AM
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.

eo_support
Posted: Friday, November 10, 2023 10:58:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Yes. Setting SelectedItemIndex is the right way to achieve this.

Thanks!
grchen168
Posted: Friday, November 10, 2023 11:30:51 AM
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.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.