Hi,
I started off by requiring the edit panel on the RadGrid to be disabled on enter key press. I have managed to achieve this, the panel doesn't show anymore but the problem is that I now get an Ajax postback instead (I wasn't getting this on enter keypress before).
In the OnKeyPress for my grid I call the following javascript (see below). This does stop the edit panel appearing
Telerik version: 2009.2.826.35 VS 2008 SP1
I have a RadGrid as follows and also a RadAjaxManager so that I get a LoadingPanel for the Grid:
<telerik:RadGrid ClientSettings-AllowColumnsReorder="true" ID="GridRecordList"
runat="server" EnableLinqExpressions="true" EnableViewState="false"
AllowFilteringByColumn="true"
AllowSorting="true"
AllowAutomaticDeletes="false"
AllowAutomaticInserts="false"
AllowAutomaticUpdates="false"
AllowMultiRowEdit="false"
AllowPaging="true"
PagerStyle-Position="Bottom"
AutoGenerateEditColumn="false"
AutoGenerateDeleteColumn="false"
MasterTableView-AllowAutomaticDeletes="false"
MasterTableView-AllowAutomaticInserts="false"
MasterTableView-AllowAutomaticUpdates="false"
AllowMultiRowSelection="false"
GridLines="Horizontal"
Skin="Outlook" PageSize="20" BorderStyle="None"
onitemdatabound="GridRecordList_ItemDataBound">
<GroupingSettings CaseSensitive="false" />
<headercontextmenu>
<collapseanimation duration="200" type="OutQuint" />
</headercontextmenu>
<mastertableview AutoGenerateColumns="false">
<Columns>
<telerik:GridBoundColumn DataField="SourceRecordID" HeaderText="SourceRecordID" UniqueName="SourceRecordID" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Application.ApplicationID" HeaderText="ApplicationID" UniqueName="ApplicationID" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="DocumentCount" HeaderText="DocCount" EmptyDataText="Unknown" UniqueName="DocumentCount" Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Specialty.Name" HeaderText="Specialty" EmptyDataText="Unknown" SortExpression="Specialty.Name" UniqueName="Specialty">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Staff.ShortName" HeaderText="Staff Name" EmptyDataText="Unknown" SortExpression="Staff.ShortName" UniqueName="ShortName">
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn DataField="RecordDate" HeaderText="Record Date" EmptyDataText="Unknown" SortExpression="RecordDate" UniqueName="RecordDate" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime">
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn DataField="RecordType.DisplayName" HeaderText="Record Type" EmptyDataText="Unknown" SortExpression="RecordType.DisplayName" UniqueName="RecordType">
</telerik:GridBoundColumn>
</Columns>
<SortExpressions>
<telerik:GridSortExpression FieldName="RecordDate" SortOrder="Descending" />
</SortExpressions>
<AlternatingItemStyle BackColor="#FFF4CE" Wrap="false" BorderColor="#FFECA5" BorderStyle="Solid" BorderWidth="2px" />
<ItemStyle Wrap="false" />
<rowindicatorcolumn>
<HeaderStyle Width="20px" BackColor="Purple" />
</rowindicatorcolumn>
<expandcollapsecolumn>
<HeaderStyle Width="20px" BackColor="Purple" />
</expandcollapsecolumn>
</mastertableview>
<filtermenu>
<collapseanimation duration="200" type="OutQuint" />
</filtermenu>
<ClientSettings AllowKeyboardNavigation="true"
AllowColumnsReorder="false"
EnablePostBackOnRowClick="false"
Resizing-AllowColumnResize="true"
Scrolling-AllowScroll="true"
Selecting-AllowRowSelect="true"
KeyboardNavigationSettings-EnableKeyboardShortcuts="true">
<ClientEvents OnGridCreated="GridCreated" />
<ClientEvents OnRowClick="GridRecordList_OnRowClick" />
<ClientEvents OnRowContextMenu="RowContextMenu" />
<ClientEvents OnKeyPress="GridRecordList_OnKeyPress" />
</ClientSettings>
</telerik:RadGrid>
function GridRecordList_OnKeyPress(sender, eventArgs) {
var e = window.event;
if (eventArgs.get_keyCode() == 13) {
eventArgs.returnValue = false;
eventArgs.set_cancel(true);
eventArgs.cancelBubble = true;
eventArgs.set_cancelBubble = true;
e.cancelBubble = true;
sender.blur();
return false;
}
}