Welcome Guest Search | Active Topics | Sign In | Register

How to automatically edit an cell when the cell receives focus Options
eo_support
Posted: Wednesday, October 14, 2009 4:50:50 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
EO.Web Grid allows you to tab between cells. However when you tab into a new cell, the new cell does not automatically enter edit mode. You can handle the Grid's ClientSideOnCellSelected event to automatically put the cell into edit mode when the cell is selecte:

Code: JavaScript
function cell_selected()
{
    //Get the selected cell
    var grid = eo_GetObject("Grid1");
    var cell = grid.getSelectedCell();
	
    //Put the selected cell into edit mode
    if (cell)
        grid.editCell(cell.getItemIndex(), cell.getColIndex());
}


Code: HTML/ASPX
<eo:Grid ClientSideOnCellSelected="cell_selected" ...>
....
</eo:Grid>


Note the code assumes you have FullRowMode set to false. When FullRowMode is set true, you can only place a whole row into edit mode.
Mona
Posted: Thursday, October 15, 2009 5:32:11 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Hi,

I can't make this work. I added an alert to before the if(cell) and it alerts okay, but the grid.editcell does not seem to work.

The interesting thing is taht if I add another alert just after if - then the cell edits but after I click OK on the 2nd alert, the cell goes back to the unedit state.

Did anyone else encounter the problem?

Could you verify this is working?

Here are the settings for my grid. Let me know if you need anything else

alert(cell.getItemIndex());
//Put the selected cell into edit mode
if (cell)
grid.editCell(cell.getItemIndex(), cell.getColIndex());
alert(cell.getColIndex());

<eo:Grid runat="server" id="Grid1" AllowColumnReorder="false" AllowNewItem="false" EnableKeyboardNavigation="true"
GridLines="Both" GoToBoxVisible="True" ScrollBars="Vertical" Width="600px" Height="600px"
FixedColumnCount="1" ColumnHeaderDescImage="00050205" GridLineColor="220, 220, 220"
IsCallbackByMe="False" ItemHeight="19" ColumnHeaderAscImage="00050204" ColumnHeaderHeight="24"
Font-Size="8.75pt" Font-Names="Tahoma" ColumnHeaderDividerImage="00050203"
FullRowMode="False" ClientSideOnItemCommand="OnItemDelete" ClientSideOnCellSelected="cell_selected">

Thanks,
Mona
eo_support
Posted: Thursday, October 15, 2009 6:00:50 PM
Rank: Administration
Groups: Administration

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

Can you isolate the problem into a separate test page? Once we have the full test page, we will try to run it here and see what we can find.

Thanks
Mona
Posted: Thursday, October 15, 2009 6:06:43 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Thanks so much for the quick reply, but I just figured it out. I was trying this with an older version. I downloaded the latest version and it works fine. Sorry for the false alarm.


Mona
eo_support
Posted: Thursday, October 15, 2009 6:17:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Thanks for the update!


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.