BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
private void gridControl1_MoveCurrentCellDirection(object sender, GridMoveCurrentCellDirectionEventArgs e)
{
GridControlBase grid = sender as GridControlBase;
GridModel gridModel = grid.Model;
int row = e.RowIndex;
int col = e.ColIndex;
switch (e.Direction)
{
case GridDirectionType.Right:
{
col++;
if (col > gridModel.ColCount)
{
row++;
col = grid.LeftColIndex;
}
while (row < gridModel.RowCount)
{
using (GridStyleInfo style = grid.GetViewStyleInfo(row, col))
{
if (style.Enabled)
{
e.Result = grid.CurrentCell.MoveTo(row, col);
e.Handled = true;
return;
}
col++;
if (col > gridModel.ColCount)
{
row++;
col = grid.LeftColIndex;
}
}
}
e.Handled = true;
e.Result = false;
break;
}
case GridDirectionType.Left:
{
col--;
if (col == gridModel.Cols.HeaderCount)
{
row--;
col = gridModel.ColCount;
}
while (row > gridModel.Rows.HeaderCount)
{
using (GridStyleInfo style = grid.GetViewStyleInfo(row, col))
{
if (style.Enabled)
{
e.Result = grid.CurrentCell.MoveTo(row, col);
e.Handled = true;
return;
}
col--;
if (col == gridModel.Cols.HeaderCount)
{
row--;
col = gridModel.ColCount;
}
}
}
e.Handled = true;
e.Result = false;
break;
}
}
}
I attached a sample
Stefan
WrapRow_2779.zip