Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
get_browserEvent() not defined on Activation
posted

I have a grid with Activation behavior enabled. I defined a custom Javascript to be executed on ActiveCellChanging, where I check the key pressed. Code is:

function grdDetail_ManageKeyPress(sender, e)
{

  var evtobj = window.event ? event : e.get_browserEvent();
  if (evtobj.keyCode == 13)
  {
      sender.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().enterEditMode(e.getCurrentActiveCell());
      e.set_cancel(true);
  }

}

It works well in IE and Chrome (where window.event is defined) but fails in Firefox. Problem is that, in ActiveCellChanging and ActiveCellChanged javascript events, get_browserEvent() always returns null (checked on all browsers). In other events (like SelectionChanged for a WebDropDown) i can use get_browserEvent() successfully on all browsers.

How can I check the key pressed in these events while moving around the grid in Firefox?

Another thing: in Chrome and IE, the selected cell is highlighted (in Chrome with the webkit default border, in IE with a dotted border), in Firefox it's impossible to check which cell is selected. How can I add a border to the selected cell?

I'm using .NET Advantage 2012.1 (without any SR), Visual Studio 2010 and Framework 4.0.

I'd be thankful if you can answer me a bit quickly, it's quite urgent because I must deploy my app to my client.

Parents
  • 37874
    posted

    Hello elvander,

    I would suggest you to use selection behavior in addition to activation - this way the active cell will also be selected and thus highlighted. And you should be able to get the key pressed from the browserEvent in KeyDown event.

    Let me know if you have any questions.

Reply Children