AllowSelection = GridSelectionFlags.Column

Hi there,

I am trying to do a very simple thing : get a grid to select a full column on caption click.

AllowSelection = GridSelectionFlags.Column | GridSelectionFlags.Whatever

This should work, right? For me it doesn't.

Are some flags mutually exclusive? Are there any properties of GridControl that might prevent the column from being selectable?

Best regards and thankful in advance
Vlad


4 Replies

AD Administrator Syncfusion Team August 8, 2007 07:10 PM UTC

There are a couple of settings that may prevent the selection of Columns when you click a column header in a GridControl or GridDataBoundGrid.

Make sure the styles on the column header do not have style.Enabled = false as this would prevent the click from happening.

Another setting that would interfere with column selections is if you have the ListBoxSelectionMode set to something other than None. Setting this property to something other than None indicates you want only row selections and this will override the AllowSelections.


VS Vladislav Sergeev August 9, 2007 07:29 AM UTC

Thanks for your response, I have made sure that all of the properties are set as you have suggested and still I am not able to select a column. Can you please send me a sample solution where the GridControl would have selectable columns.

Thankful in advance
Vlad

>There are a couple of settings that may prevent the selection of Columns when you click a column header in a GridControl or GridDataBoundGrid.

Make sure the styles on the column header do not have style.Enabled = false as this would prevent the click from happening.

Another setting that would interfere with column selections is if you have the ListBoxSelectionMode set to something other than None. Setting this property to something other than None indicates you want only row selections and this will override the AllowSelections.


AD Administrator Syncfusion Team August 9, 2007 07:53 AM UTC

Below is a sample. You can select columns in a GridControl or GridDataBoundGrid by default. Just drag a GridControl onto your form and run the application. Or, just drag a GridDataBoundGrid onto your form, set its datasource, and then run the application. Then in both cases, you should be able to click a column header and select a column.

Another property you should check is if you have the GridControllerOptions.DragColumnHeader flag set in the grid.ControllerOptions property. If so, then clicking a column header will allow you to drag the column, but will not select it.

WindowsApplication97.zip


VS Vladislav Sergeev August 10, 2007 06:59 AM UTC

Clay

Thank you very much, it was indeed the GridControllerOptions.DragColumnHeader flag that prevented the column from being selected.

Vlad

Loader.
Up arrow icon