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
90
UltraGrid does not allow new rows
posted

I have two grids, Grid1 and Grid2.

I drag a row (or more rows) from Grid1 to Grid2. My business logic takes datasource of Grid2 and adds correct objects to it. Then I rebind the datasource so that Grid2 shows the dragged rows.

This works, but only until Grid2 contains about eight messages. When this amount of rows is reached, Grid2 stops showing new rows. I double-checked my business logic and it does what it should: in the data source, there really are the new objects added.

So basically, datasource has 11 rows, but Grid2 only shows 8 of them. Any idea what can be wrong here? I tried setting
Grid2.DisplayLayout.Bands[0].MaxRows = 10240
but it does not help.

Thank you very much.

Parents
No Data
Reply
  • 90
    posted

    First, thank you very much, Mike, for trying to help me!

    Then: I was able to (partially) solve the problem. What was wrong:

    I have a tree (Folders) and a grid (Messages of a Folder). Whenever I select a node on the tree, I rebind the treenode's list object to the grid. The data member of the tree is "Subfolders", the data member  of the grid is "Messages".

    Sometimes I need to change the Messages collection of a Folder, i.e. assign another collection to the folder, making the old Messages be forgotten (and waiting for GC). After I do that, I clear the databinding of the grid then rebind it with this line of code:

    grid.SetDataBinding(folder, "Messages");

    I'd suppose the grid would take the object folder and show its Messages data member. However, the grid seems to show the old Messages, and since any further change is affecting the new collection, the grid remains constant forever.

    I fixed it by not changing Messages collection; instead, I empty it and fill it with new values. It's probably a better design anyway, so no problem there.

    But I'd think it should work the other way too, am I right?

Children