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
835
Visible rows not appearing immediately
posted

I have an ultragrid that I am embedding within another control, but I am having some difficulty in getting the ultragrid to render properly. I believe this has to do with some timing issues in the following sense: When I embed the ultragrid in my custom control, I am taking an image/snapshot of the control at a particular moment and then inserting that image into my control (it's a report control, basically). What I am seeing in the report looks like the attached image...it seems that the visible rows haven't been populated yet. I've confirmed in my code that the appropriate HandleCellDataRequested events have fired (basically the datasource has been pinged, and all of the data has come into the grid). It just appears that the data is not showing for some reason.

To elaborate on this a little further, I should point out that I put the *exact* same grid code into a plain old form (one that doesn't take an image snapshot or anything) and rendered the ultragrid with data just fine (as expected); however the <UltraGrid>.Rows.VisibleRowCount (and ActiveRowScrollRegion.VisibleRows.Count) are 0 for a while after the creation of the form. It takes a few computation cycles for the Form to fully load...and *only then after the form seems to be fully loaded* does the VisibleRows property populate appropriately. The question I'm leading to is the following:

- Does the ultragrid listen for any parent control load events before creating the grid rows? If so, I'd love to know which this is so that perhaps I may mock this event in order to force the row creation (since it's possible for my scenario with the image/snapshot, the grid doesn't seem to be loading the rows in time)

- Does that ultragrid in the picture (with the headers appearing slightly grey) tell you anything about the state of the grid? I.e. does it look like it was in a "loading" state?

Thanks!

Parents
  • 469350
    Offline posted

    Hi,

    How are you taking the snapshot of the grid?

    My guess is that the grid isn't creating the row because it has never painted itself on the screen. So you probably just have to call grid.Update to force a paint.

Reply Children