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

cells of type static does not show the vertical scrollbar

I have a grid which has cell type static. One of the cell displays long text. I want to show vertical scrollbar in that cell but it does not display the scrollbar. Here is the code (Syncfusion.Windows.Forms.Grid.GridControl)panelMessages.Controls[count-1])[9,2].VerticalScrollbar = true; ((Syncfusion.Windows.Forms.Grid.GridControl)panelMessages.Controls[count-1])[9,2].Text = QueryTextBus.GetQueryText(guid); GridModel gridModel =((Syncfusion.Windows.Forms.Grid.GridControl)panelMessages.Controls[count-1]) .Model; GridStyleInfo standard = gridModel.BaseStylesMap["Standard"].StyleInfo; GridBorder border = new GridBorder(GridBorderStyle.Solid, Color.FromArgb(57, 73, 122),GridBorderWeight.Thick); standard.Borders.All = border; standard.CellType = "Static"; gridModel.RowHeights.SetRange(0,gridModel.RowCount-1,21); gridModel.RowHeights[gridModel.RowCount] = 42; count++;

3 Replies

AD Administrator Syncfusion Team August 5, 2004 03:58 PM UTC

The VerticalScrollbar is only used by the TextBox CellType. So, if you need a scrollbar in the cell, you will either have to derive your own cell type or use a TextBox celltype. If you do not want the TextBox to gain edit focus, you could handle the CurrentCellStartEditing event and cancel it if it is this cell.


UM Umangi August 5, 2004 06:15 PM UTC

Is Autosize property of cell is only available for textbox? Because I tried that with WrapText true. But that''s not working >The VerticalScrollbar is only used by the TextBox CellType. So, if you need a scrollbar in the cell, you will either have to derive your own cell type or use a TextBox celltype. If you do not want the TextBox to gain edit focus, you could handle the CurrentCellStartEditing event and cancel it if it is this cell.


AD Administrator Syncfusion Team August 5, 2004 06:37 PM UTC

Autosize only works when your user types into a cell. If you want to programmatically autosize columns, you need to call grid.Model.ColWidths.ResizeToFit.

Loader.
Up arrow icon