So, I'm trying to set up my grid with keyboard shortcuts. The following shortcuts work well: grid focus (ctrl-Y), item navigation (up/down keys), insert new item (ctrl-I), edit active item (enter key), and cancel insert/edit (esc key). However, when an item is in insert/edit mode and I want to save the changes, I should be able to hit the enter key -- but, the grid sorts and I lose all my changes when I hit the enter key. Why is the grid sorting??? I imagine that if I can solve the sorting issue, then the changes will be saved appropriately -- I hope.
Below is my grid markup...
| <telerik:RadGrid ID="grdCodeLists" runat="server" |
| GridLines="None" AllowPaging="true" PageSize="10" |
| AllowSorting="true" AllowFilteringByColumn="false" |
| AutoGenerateColumns="false" ShowGroupPanel="false" |
| AllowMultiRowEdit="false" AllowAutomaticDeletes="false" |
| AllowAutomaticInserts="false" AllowAutomaticUpdates="false" |
| OnNeedDataSource="grdCodeLists_NeedDataSource" |
| OnInsertCommand="grdCodeLists_InsertCommand" |
| OnUpdateCommand="grdCodeLists_UpdateCommand" |
| OnDeleteCommand="grdCodeLists_DeleteCommand"> |
| <ClientSettings |
| EnableRowHoverStyle="true" |
| AllowKeyboardNavigation="true"> |
| <Selecting AllowRowSelect="true" /> |
| <KeyboardNavigationSettings |
| EnableKeyboardShortcuts="true" |
| AllowActiveRowCycle="true" |
| FocusKey="Y" RebindKey="R" InitInsertKey="I" /> |
| <ClientEvents OnRowSelected="RowSelected" /> |
| </ClientSettings> |
| <SortingSettings |
| SortedAscToolTip="Click to sort descending..." |
| SortedDescToolTip="Click to sort ascending..." |
| EnableSkinSortStyles="true" /> |
| <PagerStyle |
| AlwaysVisible="true" |
| Mode="NextPrevAndNumeric" |
| Position="Bottom" /> |
| <MasterTableView |
| TableLayout="Fixed" |
| EditMode="InPlace" |
| CommandItemDisplay="None" |
| DataKeyNames="CodeListID" |
| AllowNaturalSort="false"> |
| <SortExpressions> |
| <telerik:GridSortExpression FieldName="CodeListName" SortOrder="Ascending" /> |
| </SortExpressions> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Code List ID" DataField="CodeListID" MaxLength="4" UniqueName="colID" /> |
| <telerik:GridBoundColumn HeaderText="Code List Name" DataField="CodeListName" SortExpression="CodeListName" |
| SortDescImageUrl="~/Images/icon_arrowDown.gif" SortAscImageUrl="~/Images/icon_arrowUp.gif" |
| MaxLength="8" UniqueName="colName" /> |
| <telerik:GridBoundColumn HeaderText="Code List Description" DataField="CodeListDescription" MaxLength="16" UniqueName="colDescription" /> |
| <telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" |
| HeaderStyle-Width="65" ButtonType="ImageButton" EditImageUrl="~/Images/icon_edit.gif" |
| UniqueName="colEdit" ItemStyle-HorizontalAlign="Center" /> |
| <telerik:GridButtonColumn HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" |
| HeaderStyle-Width="65" ConfirmText="Delete Code List?" ConfirmDialogType="RadWindow" |
| ConfirmTitle="Delete Code List" ButtonType="ImageButton" CommandName="Delete" |
| UniqueName="colDelete" ImageUrl="~/Images/icon_delete.gif" ItemStyle-HorizontalAlign="Center" /> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |