|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
|
|
Rank: Member Groups: Member
Joined: 3/15/2009 Posts: 15
|
is there any example for that issue
|
|
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.
|
|
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?
|
|
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
|
|
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; } } }
|
|
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!
|
|
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?
|
|
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!
|
|