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.

ResizeToFit does not occur after changing font

Thread ID:

Created:

Updated:

Platform:

Replies:

29716 Jun 1,2005 11:53 AM Jun 1,2005 05:10 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 1, 2005 11:53 AM

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

Administrator [Syncfusion]
Replied On June 1, 2005 03: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.

Administrator [Syncfusion]
Replied On June 1, 2005 05: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.

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.

;