I've got a WinGrid that updates the rows as the bound data is updated. I also have the filter row enabled. How do I refresh the filter drop down so that any new values are available to be filtered upon and removed ones are removed.
For example if each row represents a user and there is a column for 'logged in' if all users start with this value false then the filter dropdown should only have false. When a user has logged in and the data updated the filter drop down options should now include false.
You do not have to do anything. The list is repopulated every time it drops down.
Do you mean that the rows in the grid are being changes while the filter list is already dropped down? There's no way to "refresh" the list while it is already dropped down. You would have to close it and re-open it.
Mike,
Thanks for the reply.
Now that's interesting. Where is the list repopulated from? As it's definately not being populated with the right values.
I don't mean while it's already open. I'm seeing the wrong values when I open the drop-down. Interestingly enough if I resize the column and then do the drop-down it updates to reflect the new values. Or if I click on a row in the grid first and then on the drop down it also updates. The grid is read-only and it's when the data it's bound to changes that the drop-down is not updated.
I'll have a look at how we're doing the binding, perhaps we're doing something slightly odd.
What's the data source? Are you seeing the actual rows in the grid update? It sounds to me like your data source is not notifying the grid that an update has taken place. The dropdown gets it's values from the actual data in the column of the grid. This should be the same data that is in the dat source - unless your data source is an IList and doesn't notify the grid of changes.
I am seeing the actual rows in the grid update, so I assume that the data source must be notifying the grid of changes. The data source is a System.Windows.Forms.BindingSource, that uses a System.ComponentModel.BindingList<TItem> as it's DataSource, the BindingList is initialized from a List<TItem>. (Hope that chain made sense!). Then when one of the TItems is updated we replace the instance in the BindingSource with the new version. I didn't originally create this code... Does it look right to you? is there a 'better' way?
Simplified versions of the 2 relevant methods are below.
public
fluxmunki said:I am seeing the actual rows in the grid update, so I assume that the data source must be notifying the grid of changes.
That's a good assumption, I would think. Unless your code is explicitly refreshing the grid or something like that.
The only other thing that comes to mind is that maybe you are handling the BeforeRowFilterDropDown or BeforeRowFilterDropDownPopulate events and modifying the list in your code.
If that's not the case, then I don't know what's going on. You might try updating to the latest Hot Fix if you don't already have it. If that does not help, then the only thing to do would be to try duplicating the issue in a small sample project and then you could Submit an incident to Infragistics Developer Support. If they can see the problem, we should be able to get it resolved.