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.

Explain the use of the ColumnDescriptor.AllowDropDownCell = false in a GridGroupingControl?

 

In a GridGroupingControl, to hide the dropdown buttons in the cell which are the auto generated dropdowns that show up as part of the filter bar cells or columns that are part of the foreign-key relations, it is advantageous to set the ColumnDescriptor.AllowDropDownCell property to false. This is because, if we set the AllowDropDownCell property to false, it will prevent the listbox part of the cells from being initialized when clicked inside the cell. It will be just a normal TextBoxCell and the base grouping engine will do the mapping from id to display column.

C#

// setting the AllowDropDownCell property.

this.gridGroupingControl1.TableDescriptor.Columns["State_Name"].AllowDropDownCell = false;

VB

' setting the AllowDropDownCell property.

Me.gridGroupingControl1.TableDescriptor.Columns("State_Name").AllowDropDownCell = False

But if we set the styles properties and leave the AllowDropDownCell property to true, then the cell type is still a listbox and the listbox will be initialised when clicked inside the cell eventhough it is not editable and no button is visible.The style properties are set by using the following code:

C#

style.ShowButtons=GridShowButtons.Hide;

style.ReadOnly=true;

VB

style.ShowButtons=GridShowButtons.Hide

style.ReadOnly=true

But even if it is set, the user can be still able to dropdown the cell with ALT + Down Arrow. To prevent this, you would also need to set the Clickable property to false.

C#

style.Clickable=false;

VB

style.Clickable=false

Sample:

http://websamples.syncfusion.com/samples/kb/grid.windows/GGCAllowDropDown/main.htm

Article ID: Published Date: Last Revised Date: Platform: Control:
679 04/30/2011 07/10/2014 Windows Forms GridDataBoundGrid(Classic)
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.