Hi
I explain, I have 2 List which are datasources of 2 ultragrids. The first is a List<subObject> the second is a List<MyObject>. My object contains a List<subObject>. So when I add one item of the List<subObject> to one of the List<MyObject>, the datasource is ok, but when I refresh the ultragrid of List<MyObject>, I can see the + expendable, but when I click on it, the second band appear blank. I have dots on the left, but they links with nothing. Is it clear?
I try ultragrid.refresh, ultragrid.rows.refresh(RefreshRow.ReloadData,true) and the 2 others values of RefreshRow and always nothing. Sometimes, the second band is not blank, but I don't know why, because I have changed nothing in the code.
What's the mistake?
It's hard to say why this is not working without seeing the code. Everything you have here sounds correct to me.
Can you post a small sample project demonstrating the behavior you are getting so I can take a look?
Ok
So, here you are, the code where I change the datasource
private void ugJoinsWritings_CellListSelect(object sender, CellEventArgs e) { IEcrituresGroupees ecritures = (IEcrituresGroupees)e.Cell.Row.ListObject; F_EBANQUE_Soldable newBanque = (F_EBANQUE_Soldable)e.Cell.ValueListResolved.GetValue(e.Cell.ValueListResolved.SelectedItemIndex); //Ajout de l'écriture à la banque if(newBanque!=null) newBanque.Add(ecritures); //Retrait de l'écriture de l'ancienne Banque if (this._TemporaryOldBank != null) _TemporaryOldBank.Remove(ecritures); ((IRefreshable)this).Refresh(); this.ugBankAccounts.Rows.Refresh(RefreshRow.RefreshDisplay, true); }
//Here the method where I refresh the datasource of the ultragrid void IRefreshable.Refresh() { this.fEBANQUESoldableBindingSource.DataSource = this._banques; this.ugJoinsWritings.DisplayLayout.Bands[0].Columns["UnboundColumn1"].ValueList = this.ugJoinsWritings.DisplayLayout.ValueLists["CompteBancaire"]; this.ugBankAccounts.DataSource = fEBANQUESoldableBindingSource; this.ugBankAccounts.DataBind(); this.ugBankAccounts.Refresh(); this.ugBankAccounts.Rows.Refresh(RefreshRow.ReloadData); }
I precise that the _TemporaryOldBank is a data member. I store into it the oldValue of the valueList on BeforeCellListDropDown event. I set it to null on AfterCellListCloseUp.
I add a printscreen where we can see the trouble
I hope that's give you more informations about the trouble.
Thanks for help.
I've just tryed something. If I had an Object to the data member _banques before the row "this.fEBANQUESoldableBindingSource.DataSource=this._banques;"
Then the band 2 has something to show.
I hope that it will give you the solution of this problem.
I've found where was the problem: between the screen and the chair, me in fact. The dataSource FEBANQUESoldableDatasource was not the dataSource of the ultragrid. I use an ultradatasource for this grid, because, there is the recursivity problem.
So the problem is solved.
thanks
I made a mistake. At this time, my english is really poor. So I correct my sentence, "If I add an Object into the under collection (which will be show in the second band) of an item of the data member _banque before the row this.fEBANQUESoldable......"
I think that's better.