Home Forums WinForms controls Xceed Grid for WinForms Prevent cell focus Reply To: Prevent cell focus

User (Old forums)
Member
Post count: 23064

It is not possible to prevent the grid from scrolling to the next scrollable column, even if it is not possible to navigate or set a cell to be the current one (the row will be set as the current one).  However, a possible workaround would be to monitor if a cell from the string column is selected, and if so, set the current cell to the bool column, and bring it into view.

e.g.:

private void Form1_Load( object sender, EventArgs e )

{

    gridControl1.CurrentCellChanged +=

new EventHandler( gridControl1_CurrentCellChanged );

}

void gridControl1_CurrentCellChanged( object sender, EventArgs e )

{

    if( gridControl1.CurrentCell.ParentColumn.FieldName == “StringColumn” )

    {

        gridControl1.CurrentCell = gridControl1.CurrentCell.ParentRow.Cells[ “BoolColumn” ];

        gridControl1.CurrentCell.BringIntoView();

    }

}

 

Imported from legacy forums. Posted by André (had 284 views)