Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
9510 | Dec 22,2003 02:31 PM UTC | Dec 22,2003 04:26 PM UTC | WinForms | 2 |
![]() |
Tags: GridControl |
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); } } }
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.
This page will automatically be redirected to the sign-in page in 10 seconds.