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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selecting a row programmatically

Thread ID:





5355 Jun 30,2003 07:17 PM UTC Jul 1,2003 12:37 PM UTC WinForms 2
Tags: GridControl
Diego Diaz
Asked On June 30, 2003 07:17 PM UTC

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();

Administrator [Syncfusion]
Replied On 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;

Diego Diaz
Replied On July 1, 2003 12:37 PM UTC

Worked nicely! Thanks Clay.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon