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

Setting drop down height for CellType=GridListControl

Thread ID:





14439 May 27,2004 12:58 AM UTC May 27,2004 10:40 AM UTC WinForms 2
Tags: GridControl
Kenton Hensley
Asked On May 27, 2004 12:58 AM UTC

In a GridDataBoundGrid, while configuring the GridDataBoundColumns collection, a property for setting the height (number of rows) of the drop-down for a CellType of GridListControl, eludes me. Is there one? Many thanks to the Syncfusion team and the excellent support. --Kenton

Administrator [Syncfusion]
Replied On May 27, 2004 05:32 AM UTC

You can set this on a grid-wide basis with code such as; GridDropDownGridListControlCellRenderer cr = (GridDropDownGridListControlCellRenderer) this.grid.CellRenderers["GridListControl"]; (( GridDropDownGridListControlPart) cr.ListControlPart).DropDownRows = 2; // 2 rows in the dropdown If you need to do it on a column by column basis (or cell by cell), then you will have to handle the CurrentCellShowingDropDown event.

private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
 GridControlBase grid = sender as GridControlBase;
 if(grid != null)
  GridCurrentCell cc = grid.CurrentCell;
  GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
  if(cc != null)
   if(cc.ColIndex == 6)
      ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;
   else if(cc.ColIndex == 4)
    ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;
   else if(cc.ColIndex == 2)
    ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
    ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;

Kenton Hensley
Replied On May 27, 2004 10:40 AM UTC

Thank you Clay for the assistance. It is a small challenge for a newbie to figure out how and where everything is kept in such rich object modesl, especially for the grids where the object models vary. Two opportunities for improvement from my experience so far: First, to assist with evaluating and learning the grids a side by side comparison would greatly aid in differentiation. I found this quite time consuming. Second, in the definition of events, the documentation tends to discuss the events in terms of themselves (a defnintion without synonyms is not very helpful). I''ve found it difficult to figure out exactly what the events do or which is appropriate. More examples in the event documentation itself would be very helpful. I''m sure you have many great ideas you would like to implement given cash and time, but these struck me right away as early hurdles. Since first impressions are so important it might be a good place to spend some effort. Thank you to you and the SyncFusion team, I enjoy using the product and the results are pleasing. --Kenton


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

or the page will be automatically redirected to 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