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…
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:
Otherwise you don’t need to call form.Focus() before ShowDialog.
/Luca
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
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
Please login first to submit.