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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AllowSelection based on Col

Thread ID:





94893 Jun 8,2010 08:31 PM UTC Jun 11,2010 05:08 AM UTC WinForms 1
Tags: GridControl
Philip Bishop
Asked On June 8, 2010 08:31 PM UTC

I have a grid control with 2 cols. The first col is full of drop downs. The second col is original text boxes. I want the user to be able to select multiple rows/col header in col2. In Col1 I only want the user to be able to select one cell at a time. I know how to change the allowselection property for the whole grid but I can't seem to figure how to set that for just one col. So how can I set col2 to allow basically any selection and col1 to only click one cell at a time.



Christopher Issac Sunder K [Syncfusion]
Replied On June 11, 2010 05:08 AM UTC

Hi Philip,

Thank you for your interest in Syncfusion products.

To customize the selection of a GridControl based on columns, you can make use of Selections.Add() method under the SelectionChanged event to handle it.

public Form1()

// other codes ...

this.gridControl1.SelectionChanged += new Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventHandler(gridControl1_SelectionChanged);

void gridControl1_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e)
if (e.Range.Top > 0 && e.Range.Left == 0) // condition for row wise selection
//code to make our custom selection
this.gridControl1.Selections.Add(GridRangeInfo.Cells(e.Range.Top, 2, e.Range.Bottom, 2));
if (e.Range.Left == 1) // check if the selection made in first column
this.gridControl1.Selections.Clear(); // clear all the selections.

Please refer the following sample which illustrates the above.


Please let me know if you have any other concerns.

Christopher K.


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