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.

GridListControl - re-sizing the entire control

Thread ID:

Created:

Updated:

Platform:

Replies:

15582 Jun 22,2004 10:14 PM Jun 23,2004 04:26 AM Windows Forms 1
loading
Tags: GridControl
Lori S. Pearsall
Asked On June 22, 2004 10:14 PM

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 04:26 AM

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;
		}
	}
}

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.

;