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.

Sizing a dropdowngrid to show data without scrolling

Thread ID:

Created:

Updated:

Platform:

Replies:

12274 Mar 25,2004 06:06 AM Mar 25,2004 10:25 AM Windows Forms 2
loading
Tags: GridControl
Ron Huebner
Asked On March 25, 2004 06:06 AM

I would like to size the dropdowngrids in my VB.Net application to match the embedded grid size so all data are displayed without scroll bars. Is there a way to set the grid display area to the grid size? Can I make this the default behavior for my application?

Administrator [Syncfusion]
Replied On March 25, 2004 06:45 AM

Are you talking about using the dropdown grids as shown in the grid\samples\in depth\dropdowngrids sample? If so, this code work for me in the CurrentCellShowingDropDown event in 2030. '' subscribe to the event in FormLoad... AddHandler gridControl1.CurrentCellShowingDropDown, AddressOf gridControl_CurrentCellShowingDropDown '' the handler Private Sub gridControl_CurrentCellShowingDropDown(ByVal sender As Object, ByVal e As GridCurrentCellShowingDropDownEventArgs) Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell If cc.Renderer.GetType() Is GetType(DropDownGridCellRenderer) Then Dim grid As GridControl = CType(cc.Renderer.Model, DropDownGridCellModel).EmbeddedGrid grid.HScrollBehavior = GridScrollbarMode.Disabled grid.VScrollBehavior = GridScrollbarMode.Disabled Dim w As Integer = grid.Model.ColWidths.GetTotal(0, grid.Model.ColCount) + 16 Dim h As Integer = grid.Model.RowHeights.GetTotal(0, grid.Model.RowCount) + 16 e.Size = New Size(w, h) End If End Sub

Ron Huebner
Replied On March 25, 2004 10:25 AM

Thanks, this is exactly what I needed.

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.

;