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.RowIndex == 6)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;
else if(cc.RowIndex == 4)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;
else if(cc.RowIndex == 2)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
else
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;
}
}
}
>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.RowIndex == 6)
> ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;
> else if(cc.RowIndex == 4)
> ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;
> else if(cc.RowIndex == 2)
> ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
> else
> ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;
> }
> }
>}
>
private void Form1_Load(object sender, System.EventArgs e)
{
GridComboBoxCellRenderer cr = this.gridControl1.GetCellRenderer(5, 3) as GridComboBoxCellRenderer;
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 2;
}
I think for the comboboxbase, the height of the dropdown is determined by the height of teh ListControl that you are using for your dropdown list.
>private void Form1_Load(object sender, System.EventArgs e)
>{
> GridComboBoxCellRenderer cr = this.gridControl1.GetCellRenderer(5, 3) as GridComboBoxCellRenderer;
> ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 2;
>}
>
>
>I think for the comboboxbase, the height of the dropdown is determined by the height of teh ListControl that you are using for your dropdown list.