Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4695
ultragird - auto shrink when less records
posted

Dear all,

I have the case that if there is ultragrid with height=300 and when there are less records such that there is empty space below the records in the ultragrid, is there any method to shrink the ultragrid?

Parents
No Data
Reply
  • 20872
    Suggested Answer
    Offline posted

    Hello rchiu5hk,

    I believe that you would do this manually if you calculate the current height of your UltraGrid and compare it with the current height like:

      int desiredHeight = (ultraGrid1.Rows.Count * ultraGrid1.Rows[0].Height + ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Height);
                if (desiredHeight < 300)
                {
                    ultraGrid1.Height = desiredHeight;
                }
    Here you could add one more parameter if the GroupByBox is visible on your UI.
    Please let me know if you need any further assistance with this case.
Children