hello,
i have the problem that my clients want to copy content from an existing
cell to an new cell
using the shortcut ctrl-enter. i know how to move the cursor with ctrl-enter
to the next cell,
but the problem is that after execution of my code the datagrid focus lost
and the focus is on
the next control of my form. are there any hints of doing this in a correct
way?
my code:
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
if((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
switch(keyData)
{
case Keys.Control | Keys.Enter:
DataRow copyTo = view.Table.Rows[this.CurrentRowIndex];
DataRow copyFrom = view.Table.Rows[this.CurrentRowIndex-1];
copyTo[this.CurrentCell.ColumnNumber] =
copyFrom[this.CurrentCell.ColumnNumber];
SendKeys.Send("{Tab}");
return true;
}
}
thanks, best regards jochen
ClayB - 28 Jan 2007 19:41 GMT
Instead of using SendKeys, just try explicitly setting the currentcell
where you want it to be.
this.CurrentCell = new
DataGridCell(this.CurrentCell.RowNumber,this.CurrentCell.ColumnNumber
+ 1);
===============
Clay Burch
Syncfusion, Inc.
Jochen Stümpfig - 29 Jan 2007 19:21 GMT
thanks, this works...
regards jochen
> Instead of using SendKeys, just try explicitly setting the currentcell
> where you want it to be.
[quoted text clipped - 6 lines]
> Clay Burch
> Syncfusion, Inc.