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.

Setting drop down height for CellType=GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

14439 May 26,2004 08:58 PM May 27,2004 06:40 AM Windows Forms 2
loading
Tags: GridControl
Kenton Hensley
Asked On May 26, 2004 08:58 PM

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 01:32 AM

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;
   else
    ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;
  }
 }
}

Kenton Hensley
Replied On May 27, 2004 06:40 AM

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

CONFIRMATION

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.

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.

;