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.

GLC Resize not working the first time control is clicked

Thread ID:

Created:

Updated:

Platform:

Replies:

43420 Apr 23,2006 10:47 AM Apr 24,2006 07:46 AM Windows Forms 2
loading
Tags: GridControl
John Slater
Asked On April 23, 2006 10:47 AM

I have a GDBG with several GLC''s and I''m resizing the columns in the GridCurrentCellShowingDropDownEvent and using the Following: GridDataBoundGrid grid = (GridDataBoundGrid) sender; GridCurrentCell cc = grid.CurrentCell; if (cc.Renderer is GridDropDownGridListControlCellRenderer) { GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; cr.ListControlPart.Grid.ColWidths[colpos] = width; } The first time I click on the control, the sizes do not change, the second and subsequent clicks however; all work as expected. Using 4.102.0.62. Thanks

Administrator [Syncfusion]
Replied On April 24, 2006 12:24 AM

Hi JMS, I could see this issue. You can workaround this issue by handling the CellButtonClicked event which occurs just before the CurrentCellShowigDropDown is triggered. You can set the size of the column here. Here is the code snippet. if( this.gridDataBoundGrid1.Model[e.RowIndex,e.ColIndex].CellType == "GridListControl") { this.gridDataBoundGrid1.CurrentCell.MoveTo(e.RowIndex,e.ColIndex); GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; if(cr != null) { cr.ListControlPart.Grid.ColWidths[1] = 500; } } Here is a sample. http://www.syncfusion.com/Support/user/uploads/ColumnHeader1_5d8260ce.zip Please let me know if you need any further assistance. Thanks for choosing Syncfusion Products. Regards, Haneef

Administrator [Syncfusion]
Replied On April 24, 2006 07:46 AM

Thanks, Works perfect. >Hi JMS, > >I could see this issue. You can workaround this issue by handling the CellButtonClicked event which occurs just before the CurrentCellShowigDropDown is triggered. You can set the size of the column here. Here is the code snippet. > >if( this.gridDataBoundGrid1.Model[e.RowIndex,e.ColIndex].CellType == "GridListControl") >{ > this.gridDataBoundGrid1.CurrentCell.MoveTo(e.RowIndex,e.ColIndex); > GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; > GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; > if(cr != null) > { > cr.ListControlPart.Grid.ColWidths[1] = 500; > } >} > >Here is a sample. >http://www.syncfusion.com/Support/user/uploads/ColumnHeader1_5d8260ce.zip > >Please let me know if you need any further assistance. > >Thanks for choosing Syncfusion Products. >Regards, >Haneef >

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.

;