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

GridListControl Woes

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[1] + gridControl1.ColWidths[2], 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 v1.6.1.8, because I had licencing bugs with the latest version. Can you please help? Thank you. Raul Rosenthal SDB SpA

1 Reply

AD Administrator Syncfusion Team September 29, 2004 05:59 AM UTC

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
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
	End If
End Sub

Live Chat Icon For mobile
Up arrow icon