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
1365
Collection not refreshing
posted

I've set the dataschema manually in my ultraGrid1 (version: 12.1.20121.2135).

I have a List<Person> and every Person class has a List<Order>.

The datasource property of the grid is simply set at runtime, like:

List<Person> People = DummyRepository.GetPeople();

ultraGrid1.Datasource = People;

At first none of the people have an Order in their collection. At runtime the user can add an order. When the user does this I set the datasource again with People. But unfortunatly it doesn't show the added Order. I tried after setting the datasource property:

ultraGrid1.Rows.Refresh(Infragistics.Win.UltraWinGrid.RefreshRow.ReloadData)

ultraGrid1.Rows.Refresh(Infragistics.Win.UltraWinGrid.RefreshRow.RefreshDisplay) 

And even:

ultraGrid1.Databind()

Nothing helps.

The only thing that seems to help is setting the datasource to null first and then setting the datasource to the collection. But then I have another problem, which I'm not sure I should get in to right now. You see I also have custom Row Layouts which I havent mentioned yet. But if I set the datasource to null the grid loses the custom row layout I designed in the designer at runtime.

I can set the datasource to null and keep displaylayouts by first saving and then loading the displaylayout, but... That shouldn't be the solution. Feels pretty forced to me. Besides I'll lose other properties like spacing between rows and such appearances.

So... How can I solve this?

Parents Reply Children