I have a collection of BLPerson objects which I bind to a grid via a bindingsource as shown in the psuedo code below. The BLPerson object conatins a child which is a collection of BLUserid objects.
BLCollection<BLPerson> AllPeople = GetPeople(); /*go to db and get all people*/bLPersonBindingSource.DataSource = AllPeople;this.PersonGrid.DataSource=bLPersonBindingSource
when the User clicks on the "+" of the parent to display the Userids, i do the following (in the BeforeRowExpanded) in an attempt to force the child data to be refreshed from the database. But the data is not refreshed. I know this because i have manually added a row to the database before expanding the parent and it doesn't show.
AllPeople = GetPeople() this.bLPersonBindingSource.ResetBindings(false);this.PersonUltraGrid.ActiveRow.Refresh(RefreshRow.ReloadData,true);
Can anyone explain what i should be doing to ensure that when a parent is expanded, the child data is retrieved from the db and displayed.
Thanks jv
Hi jv,
The only other suggestion I have would be to make sure you are using the latest service release.
If that doesn't help, or you are already using the latest, then you should try to duplicate the problem in a small sample project and Submit an incident to Infragistics Developer Support so they can check it out.
Mike,
>>The best way for this to work is if your data source sends a notification to the grid when the items is >>added. Does your collection class implement IBindingList?No but it sounds like this may be the best solution in the long term
>>You might try:>>this.PersonUltraGrid.Rows.Refresh(RefreshRow.ReloadData, true); or >>this.PersonUltraGrid.ActiveRow.ChildBands[0].Rows.Refresh(RefreshRow.ReloadData, true);Neither of these worked
Before I send a support incicdent there are 2 things I should proabably have mentioned before. Firstly the problem is intermittent and secondly if I click on another row and then go back and expand the original row the refresh always works.
If you have any other ideas then let me know.
Thanks for your help jv
Hi,
The best way for this to work is if your data source sends a notification to the grid when the items is added. Does your collection class implement IBindingList?
If that's not an option, then you need to force the grid to refresh. ResetBindings probably won't help and might even cause more problems.
I would think that the Refresh method is the right way to go. I'm not sure why that doesn't work.
You might try:
this.PersonUltraGrid.Rows.Refresh(RefreshRow.ReloadData, true);
or
this.PersonUltraGrid.ActiveRow.ChildBands[0].Rows.Refresh(RefreshRow.ReloadData, true);
If neither of those work, then I'm not sure why it's not working. The next step would be to try to reproduce the problem in a small sample project and either post it here or Submit an incident to Infragistics Developer Support so that we can take a look.