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

Resize last column width (GridControl CellType: GridListControl)

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

1 Reply

RC Rajadurai C Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon