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
100
Set the ultraWinGrid height depending on the sum of all row height
posted

Hello,

I have a function that resize my grid height with the sum of all rows height but this method is really slow because the access to all the rows height property take too many time. Here is an example of what i mean:

   foreach (UltraGridRow row in grid.Rows)
             grid.height += row.height;

I found an other way to do it, faster but don't work if their is some multiline cell in the grid. I just multiply the number of row by the default row height:

    grid.Height = grid.Rows.Count * grid.DisplayLayout.Override.DefaultRowHeight;

I read in some forum that i can use the scrollBar size to determine the height of my grid but i don't know how to do.

Parents
  • 71886
    Offline posted

    Hello,

    Firstly, I cannot imagine how you could have so many rows that the 'foreach' is slowing down your application and in the same time the grid is being resized to a large height and is visible. So here is our scenario - we have a lot of UIElements which are strongly individual when it comes down to 'Height'. We have to know what is the exact height of every one of these elements. So we will have to examine them, there is no other way.

    Could you please clarify in details what have you read about this scrollbar approach?

    I will be happy to assist you further on that matter. and please feel free to let me know if meanwhile a question about our toolset comes up on your mind.

Reply Children
No Data