I''m trying to resize the combo that drops down from a grid cell using the follwing code:
private void gridControl1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
e.Size = new Size( gridControl1.ColWidths + gridControl1.ColWidths, e.Size.Height );
because the combo displays two columns and I want it to be aligned with the columns in the grid.
Alas, it does not appear to work, or to work sometimes only.
Moreover, the combo sports an horizontal scrollbar every other time it is displayed (i.e. The user opens the combo and the scrollbar is there. The next time the combo opens, no scrollbar. Next time it''s there again)
Also, I''d like to be able to resize the columns in the combo to match the size of the columns in the grid, but don''t know how.
Please note that I am still using v220.127.116.11, because I had licencing bugs with the latest version.
Can you please help?
ADAdministrator Syncfusion Team September 29, 2004 01:59 AM
You will also have to explicitly set the column widths within the embedded grid in the GridListControl. Here is code that worked for me in version 18.104.22.168.
Private Sub gridControl1_CurrentCellShowingDropDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs)
Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
If Me.gridControl1(cc.RowIndex, cc.ColIndex).CellType = "GridListControl" Then
Dim cr As GridDropDownGridListControlCellRenderer = cc.Renderer
''cr.ListControlPart.AutoSizeColumns = False
cr.ListControlPart.Grid.ColWidths(1) = Me.gridControl1.ColWidths(1) - 1
cr.ListControlPart.Grid.ColWidths(2) = Me.gridControl1.ColWidths(2) - 1
e.Size = New Size(Me.gridControl1.ColWidths(1) + Me.gridControl1.ColWidths(1), e.Size.Height)
cr.ListControlPart.Grid.HScrollBehavior = GridScrollbarMode.Disabled