GridListControl - re-sizing the entire control

I''m trying to make the total width of the dropdown narrower as it extends WAY past the edge of my form and doesn''t need to. In the CurrentCellShowingDropDown event, I''ve set the following widths : GridDropDownGridListControlCellRenderer.PopupControlContainer.PopupHost.Width GridDropDownGridListControlCellRenderer.PopupControlContainer.Width GridDropDownGridListControlPart.Width GridDropDownGridListControlPart.Grid.Width None of them are making any difference. How do I change the size of the dropdown? Thanks!

1 Reply

AD Administrator Syncfusion Team June 23, 2004 08:26 AM UTC

Are you setting e.Size? Setting this event arg property in CurrentCellShowingDropDown is normally how the dropdown width is controlled. For ComboBoxes and GridListControl cells, you control the number of items displayed in the list by setting the DropDownRows property at some point (in CurrentCellShowingDropoDown is OK or you can do it in FormLoad if it is fixed grid-wide).
private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.ColIndex == 1 && cc.RowIndex == 23)
	{
		GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
		if(cr != null)
		{
		((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 3;
			cr.ListBoxPart.BackColor = Color.Blue;
		}
	}
	else if(cc.ColIndex == 1 && cc.RowIndex == 35)
	{
		GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
		if(cr != null)
		{
			((GridDropDownGridListControlPart)cr.ListControlPart).DropDownRows = 3;
			cr.ListControlPart.BackColor = Color.Blue;
			cr.ListControlPart.ShowColumnHeader = false;
		}
	}
}

Loader.
Up arrow icon