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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridListControl - re-sizing the entire control

Thread ID:





15582 Jun 23,2004 02:14 AM UTC Jun 23,2004 08:26 AM UTC WinForms 1
Tags: GridControl
Lori S. Pearsall
Asked On June 23, 2004 02:14 AM UTC

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!

Administrator [Syncfusion]
Replied On 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;


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

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

Live Chat Icon For mobile
Live Chat Icon