SelectNextControl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • VJ

    SelectNextControl

    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 SelectNextContr ol does not work.. I even tried
    base.Parent.Sel ectNextControl, its of no use.. I have the code below..

    private void dataGrid1_Curre ntCellChanged(o bject sender,
    System.EventArg s e)
    {

    int rowChanging = dataGrid1.Curre ntCell.RowNumbe r;
    DataTable table = dataSet.Tables[0];
    int intMaxRows = tSheet.Rows.Cou nt - 1;

    if (dataGrid1.Curr entCell.ColumnN umber == 7)
    {
    if (dataGrid1.Curr entCell.RowNumb er >= intMaxRows - 1 )
    {
    //Select the next control in tab order i.e the btnSave

    dataGrid1.Selec tNextControl(bt nSave,true,fals e,true,true);

    //dataGrid1.Selec tNextControl(bt nSave,true,fals e,true,true); - this does not
    work either..

    //base.parent.Sel ectNextControl( btnSave,true,fa lse,true,true); - this does
    not work either..
    return;
    }
    //setfoucs to next rows first cell.
    dataGrid1.Curre ntCell = new DataGridCell(ro wChanging + 1,1);
    }

    }

    on debugging the "SelectNextCont rol" 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



  • VJ

    #2
    Re: SelectNextContr ol

    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 SelectNextContr ol does not work.. I even tried
    base.Parent.Sel ectNextControl, its of no use.. I have the code below..

    private void dataGrid1_Curre ntCellChanged(o bject
    sender,System.E ventArgs e)
    {

    int rowChanging = dataGrid1.Curre ntCell.RowNumbe r;
    DataTable table = dataSet.Tables[0];
    int intMaxRows = table.Rows.Coun t - 1;

    if (dataGrid1.Curr entCell.ColumnN umber == 7)
    {
    if (dataGrid1.Curr entCell.RowNumb er >= intMaxRows - 1 )
    {
    //Select the next control in tab order i.e the btnSave

    dataGrid1.Selec tNextControl(bt nSave,true,fals e,true,true);

    //dataGrid1.Selec tNextControl(bt nSave,true,fals e,true,true); - this does not
    work either..

    //base.parent.Sel ectNextControl( btnSave,true,fa lse,true,true); - this does
    not work either..
    return;
    }
    //setfoucs to next rows first cell.
    dataGrid1.Curre ntCell = new DataGridCell(ro wChanging + 1,1);
    }

    }

    on debugging the "SelectNextCont rol" 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


    Comment

    Working...