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

ResizeToFit does not occur after changing font

I using the GridControl (3.201.1.0). I am setting the new font in QueryCellInfo as follows: Private Sub NAGrid_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs) Handles MyBase.QueryCellInfo Dim selNA As NA '' Apply the style on this cell. If e.RowIndex > 0 AndAlso e.ColIndex > 0 Then selNA = _GridData.Item(_Note_Flag, e.RowIndex - 1) If Not selNA Is Nothing Then Dim gf As New GridFontInfo(NAController.GetFont(selNA)) e.Style.Font = gf End If End If End Sub The font information is retrieved from an external object collection. This is all being triggered by the user modifying the font and then updating the object collection. After object collection has been updated I call Me.grdNotes.RowHeights.ResizeToFit(GridRangeInfo.Table) The font is changed, but the ResizeToFit does not happen. I have tried to refresh the grid, invalidate the grid, set focus, but nothing works. Only when I click on the area near the cell border that would drag the cell does the resize occur. I don''t understand why I can''t make that happen through code. Per

2 Replies

AD Administrator Syncfusion Team June 1, 2005 02:52 PM

Is there a call to grid.BeginUpdate that has not be closed off by a call to grid.EndUpdate. If so, this may affect the grid doing its grid.RowHeights.ResizeToFit code. You can check this by testing grid.Updating before your ResizeToFit call. Another thing to try is between where youhave set teh font and where you call ResizeToFit, try calling grid.ResetVolatileData to see if that will affect this program. If you can upload a sample showing the problem, we can try to spot the problem here.


AD Administrator Syncfusion Team June 1, 2005 04:10 PM

Thanks Clay, grid.ResetVolatileData() fixed the issue. Per >Is there a call to grid.BeginUpdate that has not be closed off by a call to grid.EndUpdate. If so, this may affect the grid doing its grid.RowHeights.ResizeToFit code. You can check this by testing grid.Updating before your ResizeToFit call. > >Another thing to try is between where youhave set teh font and where you call ResizeToFit, try calling grid.ResetVolatileData to see if that will affect this program. > >If you can upload a sample showing the problem, we can try to spot the problem here.

Loader.
Live Chat Icon For mobile
Up arrow icon