V
VJ
I am in the last row of my datagrid and in the last but one column. I don't
want the user to tab to the last column, but to my save button. How do I
accomplish this?, using SelectNextControl does not work.. I even tried
base.Parent.SelectNextControl, its of no use.. I have the code below..
private void dataGrid1_CurrentCellChanged(object sender,
System.EventArgs e)
{
int rowChanging = dataGrid1.CurrentCell.RowNumber;
DataTable table = dataSet.Tables[0];
int intMaxRows = tSheet.Rows.Count - 1;
if (dataGrid1.CurrentCell.ColumnNumber == 7)
{
if (dataGrid1.CurrentCell.RowNumber >= intMaxRows - 1 )
{
//Select the next control in tab order i.e the btnSave
dataGrid1.SelectNextControl(btnSave,true,false,true,true);
//dataGrid1.SelectNextControl(btnSave,true,false,true,true); - this does not
work either..
//base.parent.SelectNextControl(btnSave,true,false,true,true); - this does
not work either..
return;
}
//setfoucs to next rows first cell.
dataGrid1.CurrentCell = new DataGridCell(rowChanging + 1,1);
}
}
on debugging the "SelectNextControl" gets hit exactly when the user tabs out
of the last but one cell of the lastrow.. but the foucs does not get set to
the next control..
VJ
want the user to tab to the last column, but to my save button. How do I
accomplish this?, using SelectNextControl does not work.. I even tried
base.Parent.SelectNextControl, its of no use.. I have the code below..
private void dataGrid1_CurrentCellChanged(object sender,
System.EventArgs e)
{
int rowChanging = dataGrid1.CurrentCell.RowNumber;
DataTable table = dataSet.Tables[0];
int intMaxRows = tSheet.Rows.Count - 1;
if (dataGrid1.CurrentCell.ColumnNumber == 7)
{
if (dataGrid1.CurrentCell.RowNumber >= intMaxRows - 1 )
{
//Select the next control in tab order i.e the btnSave
dataGrid1.SelectNextControl(btnSave,true,false,true,true);
//dataGrid1.SelectNextControl(btnSave,true,false,true,true); - this does not
work either..
//base.parent.SelectNextControl(btnSave,true,false,true,true); - this does
not work either..
return;
}
//setfoucs to next rows first cell.
dataGrid1.CurrentCell = new DataGridCell(rowChanging + 1,1);
}
}
on debugging the "SelectNextControl" gets hit exactly when the user tabs out
of the last but one cell of the lastrow.. but the foucs does not get set to
the next control..
VJ