Welcome Guest Search | Active Topics | Sign In | Register

can I set the focus on certain cell? Options
Wael
Posted: Saturday, March 28, 2009 3:55:54 AM
Rank: Member
Groups: Member

Joined: 3/15/2009
Posts: 15
Dear EO support,

The grid I used is not connect with database table. the user can enter the data with AllowNewItem property is true. I need to set focus to certain cell in certain row. can I do that?


Thanks a lot
eo_support
Posted: Saturday, March 28, 2009 7:55:02 AM
Rank: Administration
Groups: Administration

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

You can set these two properties to select a cell:

http://doc.essentialobjects.com/library/1/eo.web.grid.selectedcellindex.aspx
http://doc.essentialobjects.com/library/1/eo.web.grid.selecteditemindex.aspx

Or set these two properties to edit a cell:

http://doc.essentialobjects.com/library/1/eo.web.grid.editcellindex.aspx
http://doc.essentialobjects.com/library/1/eo.web.grid.edititemindex.aspx

Note if the Grid is in full row mode, then you should only set the item index, not the cell index.

Thanks!
Wael
Posted: Saturday, March 28, 2009 10:06:12 AM
Rank: Member
Groups: Member

Joined: 3/15/2009
Posts: 15

is there any example for that issue


eo_support wrote:
Hi,

You can set these two properties to select a cell:

http://doc.essentialobjects.com/library/1/eo.web.grid.selectedcellindex.aspx
http://doc.essentialobjects.com/library/1/eo.web.grid.selecteditemindex.aspx

Or set these two properties to edit a cell:

http://doc.essentialobjects.com/library/1/eo.web.grid.editcellindex.aspx
http://doc.essentialobjects.com/library/1/eo.web.grid.edititemindex.aspx

Note if the Grid is in full row mode, then you should only set the item index, not the cell index.

Thanks!
eo_support
Posted: Saturday, March 28, 2009 10:10:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. There is nothing for the sample to to demonstrate here. You just set the property and that's it. It's a single line of code, or if choose to set it at design time, there is no code involved at all.
Wael
Posted: Sunday, March 29, 2009 3:54:58 AM
Rank: Member
Groups: Member

Joined: 3/15/2009
Posts: 15
sorry but I new in ASP.NET field. :-)
where can i put this single line in my code?
eo_support
Posted: Sunday, March 29, 2009 9:04:49 AM
Rank: Administration
Groups: Administration

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

You will need to seek help from other resource for this. We do not provide support on generic ASP.NET coding questions.

Thanks
David
Posted: Thursday, April 1, 2010 3:51:12 AM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
Using EditItemIndex, the grid will not enter edit mode, even by setting it at design time.
My code simplified is below, what am I doing wrong?

<eo:Grid ID="GridEntry" runat="server" KeyField="Entry" ColumnHeaderDividerImage="00050103" GridLines="Horizontal" ColumnHeaderHeight="24" FullRowMode="true" GridLineColor="220, 223, 228" BorderColor="#7F9DB9" AllowColumnReorder="false" Height="100px" ClientSideBeforeEditItem="beforeEditGrid" ClientSideAfterEditItem="afterEditGrid" OnItemCommand="GridEntry_ItemCommand">

function beforeEditGrid() {
var btn = $get('<%= this.ButtonDelete.ClientID %>');
btn.disabled = true;
}
function afterEditGrid() {
var grid = eo_GetObject("GridEntry");
var item = grid.getSelectedItem();
grid.raiseItemCommandEvent(item.getIndex(), "update");
}

code behind:
protected void GridEntry_ItemCommand(object sender, EO.Web.GridCommandEventArgs e)
{
if (e.CommandName == "update")
{
if (GridEntry.ChangedItems.Length > 0)
{
if(UpdateEntries(e) == false)
{
GridEntry.EditItemIndex = e.Item.Index;
}
}
else
{
GridEntry.EditItemIndex = e.Item.Index;
}
}
}
eo_support
Posted: Thursday, April 1, 2010 8:49:31 AM
Rank: Administration
Groups: Administration

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

Your code looks correct to us. If you can trim down it into a single test page, we will be happy to run it here and see if we can find anything for you.

Thanks!
David
Posted: Thursday, April 1, 2010 3:16:47 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
Thanks for your suggestion.
While creating my sample page I found the problem. It was in the ClientSideBeforeEditItem method.
For some reason the code var btn = $get('<%= this.ButtonDelete.ClientID %>'); returns null after the item has been edited.
I changed it to the below to check for null and now the grid will go into edit mode by setting the EditItemIndex :
function beforeEditGrid() {
var btn = $get('<%= this.ButtonDelete.ClientID %>');
if (btn != null) {
btn.disabled = true;
}
}

The problem is now my Delete button gets enabled if the update failed validation and the grid is in edit mode.
Do you know how I could access the disabled button?

eo_support
Posted: Thursday, April 1, 2010 3:50:27 PM
Rank: Administration
Groups: Administration

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

I don't see anything wrong with your code. If you believe the problem is related to the Grid, please try to isolate it into a test page and we will be happy to take a look. Otherwise we will assume this is a general Web programming question, which our support will not cover.

Thanks!


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.