Getting an Infragistics UltraWinGrid to resize height when adding or removing rows

10,913

Basically the approach would depend on the current settings of your UltraGrid. Assuming that you have all rows with the same height than you could use something like the following:

int gridHeight = ultraGrid1.Rows.Count *ultraGrid1.DisplayLayout.Override.DefaultRowHeight + ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Height + ultraGrid1.DisplayLayout.Bands[0].Header.Height + someConst;

Where the Column header and the Band header might not present into your layout. The "someConst" refering to the "BorderStyleRow" property becasue the row border should also be taken into account when calculating the UltraGrid height. One more thing that you would like to consider would be the height of the GroupByBox if it is visible in your UltraGrid.

If this approach does not work for you please provide me more details of exact settings in your UltraGrid so I will try to assist you further with this matter.

Share:
10,913

Related videos on Youtube

Andrew Hartland
Author by

Andrew Hartland

Updated on June 04, 2022

Comments

  • Andrew Hartland
    Andrew Hartland almost 2 years

    I am looking for the best approach to getting the vertical height of a UltraWinGrid to change based on the number of rows it is bound to such that all rows are visible with no scroll bar. The intention is to stack several grids vertically in a scroll panel so only a single panel scroll bar appears when necessary rather than a scroll bar for each grid.