Hello,
I use an ultragrid (last 2011vol2) bound to a datasource (a bindinglist).
In the display layout of my grid, I grouped by a column. So I have some groups in my grid, and each group have some rows / data.
Now, when I update my datasource, removing some elements of my bindinglist, the very first group in my grid is not updated: i see only one row (!), while the others groups in the grid are well updated according to the datasource.
The first group can be different (according to the current sort), but each time I remove data in my datasource the current first group has this strange update (only one row is displayed)
Am I missing something or is it a know bug ? I am a bit stuck, I already tried to programmaticaly refresh the grid, to force a sort, but this first group does not want to refresh !
Edit: It only happens when I remove elements in my datasource related to the first row of my first group.
Hi,
What exactly do you mean when you say "removing some elements of my bindinglist". What "elements" are you referring to?
Do you mean you are removing rows from the data source?
What do you mean by "I see one row?" What row? How many rows should you be seeing?
What kind of BindingList are you using? Is this a BindingList<T>? Or is this some other class on which you have implemented IBindingList?
Can you post a small sample project demonstrating the issue so we can check it out? It sounds like this might be a bug in the grid, but it's hard to tell without more information.
Hello Mike,
Here is a small project reproducing the bug.
Will send the file from home....
I ran your sample and I see the behavior you are describing.
This appears to be caused by the last three lines of code in your button click where you are clearing the grouping and then re-grouping. There's no need to do this.
My guess is that it causes a problem because the grid handles notifications from the BindingManager asynchronously. So the grid hasn't yet fully responded to the changes you made to the data source when you re-apply the grouping, and so things get a little messed up.
To confirm this theory, I tried to force the grid to process any pending data source notifications before clearing and restoring the grouping. This is very easy - all you have to do is call UltraGrid1.Update().
When I add that line of code immediately before the SortedColumns.Clear method, it works fine.
But ideally, I would try to avoid removing the groups and then re-adding them. As I said, there's no reason to do that and it can cause problems - not to mention that it is not very efficient.
Here it is.
I hope it will work this time !
PS: may be you can delete the previous messages.
I downloaded the file you linked here, but it will not unzip. I get an error saying it's not a valid archive.
You don't need to host your files externally, you can attach a file to your post by replying and switching to the Options tab.
/up
Did you have the time to check the project ?
Finally a link to the file !!
http://www.woofiles.com/dl-287148-JABtkQSf-UltragridBug.zip