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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Resize last column width (GridControl CellType: GridListControl)

Thread ID:

Created:

Updated:

Platform:

Replies:

92311 Jan 5,2010 10:48 AM UTC Jan 5,2010 12:28 PM UTC WinForms 1
loading
Tags: GridControl
Hanson Liao
Asked On January 5, 2010 10:48 AM UTC

Hi:

I use GridControl and set cellType to be "GridListControl".
Please see the attachment. Because the content of "Comment"
is too long, I let user resizing the column width by himself.
However, last column width can not be adjusted to longer!
Please help.


By the way, is there any method to let the dropdowngrid show scroll bar automatically while width of grid is not enough?



////////////////////
code snippet:

Dim cc As GridCurrentCell = grid1.CurrentCell
Dim listCtrlPart As GridListControl = CType(cc.Renderer, GridDropDownGridListControlCellRenderer).ListControlPart

grid1(cc.RowIndex, cc.ColIndex).DataSource = ...
grid1(cc.RowIndex, cc.ColIndex).DisplayMember = ...
grid1(cc.RowIndex, cc.ColIndex).ValueMember = ...

listCtrlPart.Grid.ResizeColsBehavior = GridResizeCellsBehavior.ResizeSingle






Resize last column width_d702fd6f.zip

Rajadurai C [Syncfusion]
Replied On January 5, 2010 12:28 PM UTC

Hi Hanson,

Thanks for your interest in Syncfusion Products.

The dropdowngridlistcontrol in gridcontrolcell resizes based on the cellcontents by default. Please ensure that the FillLastColumn property is set to false and the AutoSizeColumns property is set to true.

Dim list As GridDropDownGridListControlPart = TryCast(rend.ListControlPart, GridDropDownGridListControlPart)
list.AutoSizeColumns = True
list.FillLastColumn = False

If you would like to show the horizontal scrollbar in dropdowngridlistcontrol, you can handle the CurrentCellShowingDropDown event of GridControl and handle the following code in it.

Dim cc As GridCurrentCell = Me.gridControl1.CurrentCell
If TypeOf cc.Renderer Is GridDropDownGridListControlCellRenderer Then
Dim cr As GridDropDownGridListControlCellRenderer = TryCast(cc.Renderer, GridDropDownGridListControlCellRenderer)
If cr IsNot Nothing Then
e.Size = New Size(65, 100)
End If
End If


Regards,
Rajadurai

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.

Warning Icon 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.Close Icon

;