10913 : Is there a way to define the height so that all elements are displayed?

Question

Web application using Gantt_ASP

is there a way to define the height so that all elements are displayed?
Or is there a command that tells if an element is not displayed?

I have a gantt that is connected to a database, so the size of the gantt could be very large, or very small. Is there a way to check how big the gantt should be?

Gantt_ASP.height = node.row1 + rode.row2…….. + header ???
or is there a way to check that a node is displayed?

Answer

You can check the Gantt.Grid.GridStructure.LastDrawnNode property. You can check the rectangle of a cell of this node.< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

To make sure you are working with current data you should call Gantt.Grid.Refresh() before checking the LastDrawnNode.

 

10540 : How can i set the Height of gantt_ASP, so that all rows just fit into the gantt-(border) ?

Question

I use a gantt in my ASP.NET project:

The poperties UseExpandedRowHeights and CollisionDetectionSyncron are set to true, so that my rows have different sizes.

How can i set the Height of the gantt, so that all rows just fit into the gantt-(border) ?

Answer

You will need to load the data, then iterate the rows in Gantt_ASP.Gantt.Grid.GridStructure and sum up the heights. You will need to add the DateScaler height as well. Then set this value as the control height.

Update; this code will solve this:

  protected void Gantt_ASP1_OnClientSideChangesApplied(object sender, EventArgs e)< ?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

  {

 

    Gantt_ASP1.Gantt.Grid.Refresh();

    Gantt_ASP1.Gantt.TimeItemArea.Refresh();

    if (Gantt_ASP1.Gantt.Grid.GridStructure.LastDrawnNode != null)

    {

        Gantt_ASP1.Height = Gantt_ASP1.Gantt.Grid.GridStructure.LastDrawnNode.Rect().Bottom + Gantt_ASP1.Gantt.DateScalerHeight;

    }

 

  }