Skip to main content Skip to footer

AutoSize Columns in FlexPivotGrid

Background:

Setting the FlexPivotGrid’s AutoSizeCols property to “true” in the form’s Load event will not adjust the column’s width in relation to the data because the FlexGrid isn’t initialized until runtime. To make this property work as expected, use it as shown below in the Updated event of FlexPivot, which fires after the FlexPivot finishes updating its fields:

Dim fp = _c1FlexPivotPage.FlexPivotEngine
AddHandler fp.Updated, AddressOf FlexPivot_Updated  

Private Sub FlexPivot_Updated(sender As Object, e As EventArgs)
_c1FlexPivotPage.FlexPivotGrid.AutoSizeCols()
End Sub

Prabhat Sharma