I use the following code to draw horizontal lines on the TimeItemArea.
private void gantt1_OnTimeItemAreaPaintBackground(OffscreenDraw aOffscreenDraw, OffscreenDrawArgs e)
for (int i = 0; i < gantt1.Grid.GridStructure.RootNodes.Count; i++)
Rectangle rect = gantt1.Grid.GridStructure.RootNodes[i].Rect();
Debug.Print(rect.Top.ToString() + " " + rect.Left.ToString());
e.G.DrawLine(new Pen(new SolidBrush(Color.DeepSkyBlue)), aOffscreenDraw.CalcLeft, rect.Top, aOffscreenDraw.CalcRight, rect.Top);
What event is fired when a user resizes the height of a grid row to update the lines?
Grid.OnRowResize, this event was introduced recently and is not currently in the help file.
I tried to use the OnRowResize event to change all rows while one was changing. The grid starts to flicker and behave weird when doing this…
To solve this we introduced a new event.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
New event added OnRowResizeDone
Event fires when user has resized a row.
You can implement this event to do other changes that you want as a result of a row height change,
like if you want to change all other Grid rows the same way.
This event is available from 184.108.40.206
So your code can look like this:
/// This sample show how to detect a user row height change and how to change all the rows
/// alike after the user has released the mouse button.
void Grid_OnRowResizeDone(Grid aGrid, RowResizeDoneArgs e)
for (int i = 0; i < aGrid.GridStructure.RootNodes.Count; i++)
aGrid.GridStructure.RootNodes[i].UserRowHeight = e.GridNode.Rect().Height;
Is there an event that it fires when a row width is changed by a gui-action (not if you set it by code)?
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
' 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