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

GridControl selection problem

hi haneef,

how do i prevent multi select in GridControl?

I've set the ListBoxSelectionMode = SelectionMode.One;
it's work well at the Row but the column could not be selected anymore.

Thanks!


4 Replies

RA Rajagopal Syncfusion Team June 7, 2007 06:10 PM UTC

Hi Lim,

When you have the ListBoxSelectionMode set to anything other than None, then this will prevent the default behavior from working. The reason is that it allows only row based selections and preventing the columns from getting selected. Hence, you cannot able to select columns.

As a workaround, you handle the CellClick event and explicitly select the column if you click a header. In this way you can select the column when the ListBoxSelectionMode is set. Below is the code snippet.

void gridControl1_CellClick(object sender, GridCellClickEventArgs e)
{
if(e.RowIndex == 0 && e.ColIndex > 0)
this.gridControl1.Selections.Add(GridRangeInfo.Col(e.ColIndex));
}

Regards,
Rajagopal


JO John October 24, 2007 03:21 PM UTC


Hi,

I set the ListBoxSelectionMode to MultiExtended and found that I could no longer highlight the column headers or reorder them. So, I set the ListBoxSelectionMode back to None and it still will not allow me to highlight or drag the column headers. I tried rebuilding the project, but it does not seem to work.

I opened up two other VS 2005 solutios that also use a Syncfusion databoundgrid and tried setting the ListBoxSelectionMode to MultiExtended and None and everything seems to work the way it is supposed to. I'm not sure why this one project of mine doesn't work the way it is supposed to. Thanks!





JO John October 25, 2007 01:10 PM UTC


Hi,

I tried deleting the grid and putting in a brand new one. Then, I cleaned and rebuilt the entire solution but it still won't let me highlight or drag the columns.

AllowDragSelectedCols is set to true.

I'm not sure what to do...




J. J.Nagarajan Syncfusion Team December 28, 2007 10:37 PM UTC

Hi Coder ,

Please refer to the below sample that works fine with out any problem in highlighting column headers and dragging them with the ListBoxSelectionMode set.

http://websamples.syncfusion.com/samples/Grid.Windows/F62058/main.htm

Please let me know if you have any other questions.

Regards,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon