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

How can I select column in GridControl from code?

Thread ID:

Created:

Updated:

Platform:

Replies:

15317 Jun 16,2004 07:33 AM UTC Jun 16,2004 07:42 AM UTC Windows Forms 1
loading
Tags: GridControl
Andrey Plinda
Asked On June 16, 2004 07:33 AM UTC

If user select column 1, I need to select 3, 5, 7, 9 columns. Best regards.

Administrator [Syncfusion]
Replied On June 16, 2004 07:42 AM UTC

One way you can do this is to handle the SelectionsChanged event.
private void gridControl1_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
	if(e.Range.Equals(GridRangeInfo.Col(1)))
	{
		this.gridControl1.Selections.SelectRange(GridRangeInfo.Col(3), true);
		this.gridControl1.Selections.SelectRange(GridRangeInfo.Col(5), true);
		this.gridControl1.Selections.SelectRange(GridRangeInfo.Col(7), true);
		this.gridControl1.Selections.SelectRange(GridRangeInfo.Col(9), true);
	}
}

CONFIRMATION

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.

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

;