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.
Syncfusion Feedback

How do I enlarge the width of a grid bound column

Thread ID:

Created:

Updated:

Platform:

Replies:

9510 Dec 22,2003 02:31 PM UTC Dec 22,2003 04:26 PM UTC Windows Forms 2
loading
Tags: GridControl
Steli Andrei
Asked On December 22, 2003 02:31 PM UTC

Hello, I do have a GridDataBoundGrid and inside the grid I do have couple of GridBoundColumn(s) and their StyleInfo-CellType is set to GridListControl (I display for example BranchID, BranchName). How do I set the width of this grid to a certain size ? Thank you !

Steli Andrei
Replied On December 22, 2003 03:01 PM UTC

To be more clearer: How do I set the width of this grid that shows up in the GridBoundColumn ? It is too short and I have to use the scroll bars to navigate in the grid. >Hello, I do have a GridDataBoundGrid and inside the grid I do have couple of GridBoundColumn(s) and their StyleInfo-CellType is set to GridListControl (I display for example BranchID, BranchName). How do I set the width of this grid to a certain size ? Thank you !

Administrator [Syncfusion]
Replied On December 22, 2003 04:26 PM UTC

I am not sure whether you want to change the width of the column, or the width of the Drowpdown. To change the width of a column in a GridDataBoundGrid, you do two things: this.grid.AllowResizeToFit = false; this.grid.Model.ColWidths[colIndex] = 300; If you want to change the width of the DropDown in a GridListControl CellType, then you have to handle the CurrentCellShowingDropDown event, and set e.Size there. (Only the width is applicable in a GridListControl celltype, the height is determined by the DropDownRows parameter.
private void grid_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
	GridCurrentCell cc = this.grid.CurrentCell;
	if(cc.ColIndex == 5 ) //dropdown column
	{
		GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
		if(cr != null)
		{
		//change teh height
	((GridDropDownGridListControlPart)cr.ListControlPart).DropDownRows = 10;
			//change the width
			e.Size = new Size(400, e.Size.Height); 
		}
	}
}

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.

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

;