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
375
How to suspend grid drawing and then redisplay
posted

I have a grid with parent/child bands. The parent rows contain customer data and the child rows contain Orders for each customer.  The grid is attached to an editor button on an ultra text editor. Everything works except there is a behavior I would like to inhibit.

If I populate the text box with the customer name in code then when I click the editor button the first time the grid drops down with the parent row selected and then proceeds to open the child band and display the orders (which is the exact behavior I want). The problem is that if there are a lot of orders, the grid shows the orders scrolling as they fill. This takes some time and just doesn't look right. I'd like to suspend the display until the child band is completely filled so the user doesn't see all the orders scrolling by. Ideally, I would then like to position to the first order but that isn't critical.

I understand that grid.beginUpdate and grid.EndUpdate will stop the redraw but I'm not sure where to put them. I tried putting the beginupdate in the BeforeEditorButtonDropDown and I've tried putting the endupdate in several events but all I get is a black rectangle where the grid should be.

How would I handle this?

Linda

Parents
  • 469350
    Offline posted

    Hi Linda,

    You should place the BeginUpdate and EndUpdate around the code that populates the data.

    It's really hard to say when that is without a lot more information about your application.

    Does the grid exist on the form at design-time, or are you creating it at run-time in code?

    At what point are you binding the grid (setting the DataSource or calling SetDataBinding)?

    At what point are you adding the rows of parent/child data? Are you adding the data to the grid or to it's DataSource?

    The black rectangle you see is correct. If you stop the grid from painting, then you will see nothing until the grid paint. I'm not sure what behavior you want there. What do you want the grid to display while it is loading the data? You could probably get the grid to show the columns and a blank background if you delay calling BeginUpdate until after the first time the grid paints. But that doesn't seem like a big improvement over a black rectangle to me.

Reply Children
No Data