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 programmatically

Hello, I'm trying to do something that in theory should be very simple, but I'm getting some trouble making it to work. I just need to select a row programmatically whenever the user changes the current cell, so the row containing it will be selected. I'm executing the code listed below, but it doesn't seem to work. I am using Thanks in advance for your help, Diego Diaz gridControlResults.Model.SuspendChangeEvents(); gridControlResults.Selections.Ranges.Clear(); gridControlResults.Selections.Ranges.Add(GridRangeInfo.Row(m_lastrangeInfo.Bottom)); gridControlResults.Model.ResumeChangeEvents();

2 Replies

AD Administrator Syncfusion Team June 30, 2003 10:02 PM UTC

Here is one try at this.
private bool okToClear = false;
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
	okToClear = false;
	okToClear = false;
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;

private void grid_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
		e.Cancel = !okToClear;

DD Diego Diaz July 1, 2003 12:37 PM UTC

Worked nicely! Thanks Clay.

Live Chat Icon For mobile
Up arrow icon