|
Rank: Member Groups: Member
Joined: 2/6/2012 Posts: 13
|
Hello,
I have a Grid with all the usual code behind done for populating the grid on a server side callback. I have added some javascript as per your product demo to trap a full row item select (FullRowMode=true) to fire a server side event. That all works fine however the scroll wheel on the mouse doesn't scroll the grid items, but if I set the FullRowMode=false it does scroll fine but I need full row selection as I need to ensure the whole row when clicked is highlighted not just the cell that is clicked.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, The reason that mouse wheel does not work is because the Grid does not have focus. The reason that the Grid does not have focus is because as soon as you click it, you fire a server event. So you have to have some other ways to set the focus to the Grid first. One thing you can try is to manually call the Grid's focus method whent he Grid finishes loading. It will be something like this:
Code: HTML/ASPX
<eo:Grid ID="Grid1" ClientSideOnLoad="focus_grid" .....>
.....
</eo:Grid>
Code: JavaScript
function focus_grid()
{
eo_GetObject("Grid1").focus();
}
Please let us know if this works for you. Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/6/2012 Posts: 13
|
Many thanks - yes that works fine. Is there a way to have the keyboard up/down arrow keys to scroll the grid as well and press enter to fire the event as if the row was mouse clicked ?.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Arrow key is supported automatically if you set the Grid's EnableKeyboardNavigation to true. The Grid also automatically handles enter key if the cell is in edit mode. However if you wish to handle enter key on any cell (such as read only cell), then you will need to trap enter key yourself. Inside your own event handler you can then raises server event either through the Grid by calling the Grid's raiseItemCommandEvent method: http://www.essentialobjects.com/doc/1/jsdoc.public.grid.raiseitemcommandevent.aspxOr use any other approach to raises server event. We also have a ScriptEvent control that you can use to raise server event: http://www.essentialobjects.com/doc/1/eo.web.scriptevent.aspxHope this helps. Thanks!
|
|
Rank: Member Groups: Member
Joined: 2/6/2012 Posts: 13
|
Many thanks for your help. Will try.
|
|