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

Changin columns width.

Is any way to change others columns width by changing one columns width? Event ColWidthsChanging fired only one time after releasing left mouse button. Best regards!

1 Reply

AD Administrator Syncfusion Team June 16, 2004 12:23 PM UTC

By default, if you have several columns selected, and then change the width of one column, the grid will normally change the width of all selected columns. If you want to do something else, then you could handle ColWidthsChanged. In you handler you could then change other colwidth from code using grid.Model.ColWidths[col]. (But you would want to set a flag and test this flag to make sure you avoid recursively calls to ColWidthChanged because you are changing colwidths in the event handler.
Private inColWidthsChanged As Boolean = False
    Private Sub GridControl1_ColWidthsChanged(ByVal sender As Object, ByVal e As GridRowColSizeChangedEventArgs) Handles GridControl1.ColWidthsChanged
        If Not inColWidthsChanged Then
            inColWidthsChanged = True
            ''set other colwiths....
            inColWidthsChanged = False
        End If
    End Sub

Live Chat Icon For mobile
Up arrow icon