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
close icon

GLC Resize not working the first time control is clicked

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

2 Replies

AD Administrator Syncfusion Team April 24, 2006 04:24 AM UTC

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


AD Administrator Syncfusion Team April 24, 2006 11:46 AM UTC

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 >

Loader.
Live Chat Icon For mobile
Up arrow icon