Hi,
Try the below code to move the currentcell to the specified colindex in a grid ( same CurrentRowIndex).
public void MoveToColumn(object sender, int ColIndex)
{
GridDataBoundGrid gc = sender as GridDataBoundGrid;
int noOfMoves = gc.CurrentCell.ColIndex - ColIndex;
string KeyValue = "Left";
if (gc.CurrentCell.IsEditing)
SendKeys.Send("{Home}");
if (noOfMoves < 0)
{
KeyValue = "Right";
noOfMoves *= -1;
if (gc.CurrentCell.IsEditing)
SendKeys.Send("{End}");
}
for (int i = 0; i < noOfMoves; i++)
SendKeys.Send("{" + KeyValue + "}");
}
You can call this method using the code.
//RowSaved Event.
MoveToColumn(sender, 2);
Here is a modifed sample.
http://www.syncfusion.com/Support/user/uploads/ModifiedTestDBGrid_20b997df.zipThanks,
Haneef