10679 : Is there an event that it fires when a row width is changed by a gui-action (not if you set it by code)?

Question

Is there an event that it fires when a row width is changed by a gui-action (not if you set it by code)?

Answer

Yes, Gantt.Grid.OnRowResize

Sample in VB.NET:


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

  AddHandler Gantt1.Grid.OnRowResize, AddressOf My_OnRowResize ' add an event handle thru code 

  Gantt1.Grid.Columns.AddNew(PlexityHide.GTP.CellType.SingleText)
  Gantt1.Grid.RootNodes.AddNode()
  Gantt1.Grid.RootNodes.AddNode()
  Gantt1.Grid.RootNodes.AddNode()

End Sub

' Implement the eventhandler
Private Sub My_OnRowResize(ByVal aGrid As PlexityHide.GTP.Grid, ByVal e As PlexityHide.GTP.RowResizeArgs)
  ' If the row is getting higher than 50 pixels we stop it from growing further
  If e.Delta > 0 And e.GridNode.Rect.Height > 50 Then
    e.Delta = 0
  End If
End Sub

Leave a Reply