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.
I found out it only happens after I add a row in the middle. As soon as I only add rows at the end of the collection (datasource), Rows are being added correctly.
What kind of DataSource are you using?
Are you updating the existing DataSource with the new rows? If so, then you should not need to rebind the grid, and doing so is a bad idea, because the grid will lose any state information.
If the grid is not showing the rows, then the BindingManager is probably not getting them, either. Try binding the Microsoft DataGridView to the same data source and see if it displays all of the rows. If not, then there's something wrong with your data source or your process of adding rows to it. If the MS Grid works, then the grid is not refreshing for some reason.