Hi,
I've submitted a support ticket for this (twice), but never heard back from Telerik. So I thought I'd turn to the forums.
I'm using an older version of Telerik (2010.2.826.40). Our company is in the process of updating to a newer version but will not be ready by the time I need to release.
I'm using RadGrid and following several articles I've found online, I have successfully managed to put a page into Edit Mode (I'm using InPlace). I am able to validate input and display error messages.Basically everything is working, or was until I tried to conquer capturing the OnKeyPress event from an editable field. Specifically I want to catch the Tab Key Event (Tabbing from edit field to edit field is working fine).I want to catch the tab key in the last field of the last row so I can programmatically go to the next page.
When in edit mode, the last field is a dropdownlist. I've set up the OnKeyPress event to be caught on the client side, but the client side is never catching the event. Is it because I'm in edit mode?
I set this on the server side when initializing the grid: RadGridControl.ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress";
I have the following function on the client side:
function Grid_OnKeyPress(sender, args)
{
alert("Key Code: " + args.get_keyCode());
debugger;
// looking for tab key
if (args.keyCode == 9)
{
debugger;
}
return;
}
In the past I've successfully caught the onkeypress event from GridFilteringItem, but I was not in edit mode. Would anyone able to provide me with an example of catching the onkeypress event in edit mode? I've tried setting the attribute (Attributes.Add) various ways and am still not capturing the keypress event.
1) Row level: In ItemDataBound set GridDataItem Attributes.Add
2) Item Grid Cell: In ItemCreated & ItemDataBound GridDataItem[unique name].Attributes.Add
3) The editable dropdownlist: GridEditableItem.FindControl(dropdownlist)
4) The entire grid: .ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress"
When using Attributes.Add on the server side I used code like this:
gdi.Attributes.Add("onkeypress",
"fireCatchTabKeyCommand('" + discountSearchResultsGrid.RadGridControl.ClientID.ToString(CultureInfo.CurrentCulture) + "', '" + discountSearchResultsGrid.RadGridControl.CurrentPageIndex + "', '" + discountSearchResultsGrid.RadGridControl.MasterTableView.PagingManager.IsLastPage + "', this, event)");
Thanks.
I've submitted a support ticket for this (twice), but never heard back from Telerik. So I thought I'd turn to the forums.
I'm using an older version of Telerik (2010.2.826.40). Our company is in the process of updating to a newer version but will not be ready by the time I need to release.
I'm using RadGrid and following several articles I've found online, I have successfully managed to put a page into Edit Mode (I'm using InPlace). I am able to validate input and display error messages.Basically everything is working, or was until I tried to conquer capturing the OnKeyPress event from an editable field. Specifically I want to catch the Tab Key Event (Tabbing from edit field to edit field is working fine).I want to catch the tab key in the last field of the last row so I can programmatically go to the next page.
When in edit mode, the last field is a dropdownlist. I've set up the OnKeyPress event to be caught on the client side, but the client side is never catching the event. Is it because I'm in edit mode?
I set this on the server side when initializing the grid: RadGridControl.ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress";
I have the following function on the client side:
function Grid_OnKeyPress(sender, args)
{
alert("Key Code: " + args.get_keyCode());
debugger;
// looking for tab key
if (args.keyCode == 9)
{
debugger;
}
return;
}
In the past I've successfully caught the onkeypress event from GridFilteringItem, but I was not in edit mode. Would anyone able to provide me with an example of catching the onkeypress event in edit mode? I've tried setting the attribute (Attributes.Add) various ways and am still not capturing the keypress event.
1) Row level: In ItemDataBound set GridDataItem Attributes.Add
2) Item Grid Cell: In ItemCreated & ItemDataBound GridDataItem[unique name].Attributes.Add
3) The editable dropdownlist: GridEditableItem.FindControl(dropdownlist)
4) The entire grid: .ClientSettings.ClientEvents.OnKeyPress = "Grid_OnKeyPress"
When using Attributes.Add on the server side I used code like this:
gdi.Attributes.Add("onkeypress",
"fireCatchTabKeyCommand('" + discountSearchResultsGrid.RadGridControl.ClientID.ToString(CultureInfo.CurrentCulture) + "', '" + discountSearchResultsGrid.RadGridControl.CurrentPageIndex + "', '" + discountSearchResultsGrid.RadGridControl.MasterTableView.PagingManager.IsLastPage + "', this, event)");
Thanks.