Error with focus on a cell

0
0

Hi everyone, I have a problem on a gridview when I press INS key to insert a row and focus on the first cell … the first time I press INS key it doesn’t give focus to cell but if I select the row and I press the INS key a second time, if the cell gets focus … can you help me or what am I doing wrong …

Regards
Jack…

  • You must to post comments
1
1

Hi Jackie,

We are aware of the second issue with the datagrid keeping the focus but don’t have a solution.

The problem is that it’s done on purpose in the javascript side: when the cell terminates editing it sets the focus back on the grid. Otherwise, in some cases – especially when a user goes in/out of edit mode quickly, the focus is lost to the document body (focus management in browsers is one of the most annoying things!)

These are the solutions in cases like this:

  • Register a client event and terminate editing on the client : this.grid.AddClientEventListener(“keydown”, “if (e.getKeyIdentifier()==’F9′) this.stopEditing(false);”);
  • Terminate editing and push the update: this.grid.EndEdit(); Application.Update(this);
  • Or use the focus() call in the appear event.

Otherwise you don’t need to call form.Focus() before ShowDialog.

/Luca

  • Jackie Cespedes
    Ok … Luca … I will do the indicated … thanks …
  • You must to post comments
0
0

Thanks Levie …

Please if you check the same attachment, I think there is another error in the DataGridView focus … in the Dialog1.cs comment the line:

private void Dialog1_Appear (object sender, EventArgs e) {
//this.Focus ();
}

This is the error … in the TextBox if you double click or press the + key, the Dialog opens and the DataGrid gets the focus … but if I do the same by inserting the row (press the INS key on the DataGridView) , inside the cell if I do the same as indicated above … the Dialog opens but the DataGridView does not have the focus …

Regards

  • You must to post comments
1
1

Hi Jackie,

Thanks for reporting this issue. I’ve logged it as #2346 and will let you know when a fix is available!

You can also try adding “Application.Update(this);” right before BeginEdit() and see if that helps at all. It flushes any pending changes to the client.

Best regards,

Levie

  • Jackie Cespedes
    I did the right thing … it works … thanks …
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.