We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Selecting a row programmtically

When setting ListBoxSelectionMode = SelectionMode.One and handling the CurrentCellMoving and CurrentCellActivating events to obtain full row selection, clicking a row will mark the whole row as selected by highlighting the entire row with a different background color. How can you make this row selection programmtically i.e. how do you move the row selection to a specific row, just as if you clicked on it or move to it using the arrow keys ?

7 Replies

TZ Thomas Zueger November 18, 2003 10:23 AM UTC

Hi Per I'm using f.e. this command to move to the last row in the GDBG: this.grdContacts.CurrentCell.MoveTo( this.grdContacts.Model.RowCount, 1 ); Regards, Thomas


PM Per Millard November 18, 2003 12:01 PM UTC

> Hi Per > > I'm using f.e. this command to move to the last row in the GDBG: > this.grdContacts.CurrentCell.MoveTo( this.grdContacts.Model.RowCount, 1 ); > > Regards, > Thomas Thanx Thomas, But I've already tried using MoveTo. It returns false to indicate an error, and nothing happends Regards Per


AD Administrator Syncfusion Team November 18, 2003 12:05 PM UTC

If the grid is not visible when you are making this call, also try setting grid.ForceCurrentCellMoveTo = true;


AD Administrator Syncfusion Team November 18, 2003 03:13 PM UTC

> If the grid is not visible when you are making this call, also try setting grid.ForceCurrentCellMoveTo = true; > Hi Clay The grid is visible when making the call Any other ideas ? Regards Per


AD Administrator Syncfusion Team November 18, 2003 03:14 PM UTC

> If the grid is not visible when you are making this call, also try setting grid.ForceCurrentCellMoveTo = true; > ... by the way, the grid is virtual Regards Per


AD Administrator Syncfusion Team November 18, 2003 03:30 PM UTC

Did you try setting ForceCurrentCellMoveTo anyway? It may make things work. Other things to try are to make sure the grid has focus (like grid.Focus()), or that the grid is the active control (like this.ActiveControl = grid where 'this' is the form).


AD Administrator Syncfusion Team November 18, 2003 03:31 PM UTC

Also check whether you target cell has style.Enabled = true.

Loader.
Up arrow icon