This is a migrated thread and some comments may be shown as answers.

[Solved] RadGrid Excel-like Navigation

3 Answers 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 12 Nov 2009, 08:23 PM
I'm new to Telerik, and I'm trying to implement some grid functionality that I used to get when using an Infragistics grid.  Basically, I could navigate the individual cells of a grid using the up/down/left/right arrow keys.  It didn't matter if the cells were in the same row or a different row, as they long as they are adjoined.  Additionally, once navigated to, the cell becomes editable and I can update the value without having to take any additional steps, such as pressing an edit button, enter key, etc.  This is how people normally use Excel.  Once the user  leaves the row, an event is triggered which updates the record in the database with any changes without the user having to click a Save button.
In trying to mimick this behavior in RadGrid, I set the AllowKeyboardNavigation property to True, but it only allows me to use the up/down arrrows...and the entire record is selected, not an individual cell.  I want the individual cell to be selected, not the whole row.
How can I achieve TRUE Excel-like navigation using RadGrid? 
I'm using VS2008 and RadControls for ASP.NET AJAX - Latest Version: 2009.3 1103 (Nov 3, 2009).  I've downloaded a sample app from the forum, which is supposed to show how to implement this functionality, but apparently it is somewhat old and seems to have compile problems as my version of VS and the RadConrols are newer.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Nov 2009, 07:37 AM
Hello Brian,

Check out the following code library submission on how to achieve an excel like grid using RadGrid:
Excel-like RadGrid

Also here's a forum link where in I have submitted an application on how to implement cell editing in RadGrid:

CellEditing of RadGrid with GridBoundColumn


Probably these should help:)
Princy.
0
Marco Miccini
Top achievements
Rank 1
answered on 02 Jan 2010, 08:00 PM
Dear all,
what about having a GridTemplateColumn with inside a RadComboBox?
I mean, when in PreRender(...) event how can I obtain the RadCombobox if the dataItem[".."].Controls[0] is of DataBoundLiteralControl type that cannot explicitely casted to TextBox/Combobox?
0
Princy
Top achievements
Rank 2
answered on 04 Jan 2010, 01:58 PM
Hello Marco,

If you have the RadComboBox in the ItemTemplate of the TemplateColumn, then you can try out the following code:
c#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            RadComboBox combo = (RadComboBox)dataItem.FindControl("RadComboBoxID"); 
        } 
    } 

But if the RadComboBox is placed in the EditItemTemplate of the TemplateColumn, then you can try out the following code:
c#:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            GridEditableItem editItem = (GridEditableItem)e.Item; 
            RadComboBox combo = (RadComboBox)dataItem.FindControl("RadComboBoxID"); 
        } 
    } 

Hope this helps..
Princy.
Tags
Grid
Asked by
Brian
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Marco Miccini
Top achievements
Rank 1
Share this question
or