Closed KeoSoft closed 1 year ago
I think that's by design, the SearchMemberPath
is the only common thing among all column types, and the built in search woks the same way - it would be confusing if search and filtering would get different results.
What if we could access information about column binding, then we can use the converter to return the actual value ?
Does sorting the column work correctly on such a column with a converter?
Sorting does not work with a converter either, it sorts by the index, not by the string displayed:
Now that proves that changing the behavior would introduce inconsistencies between sorting and filtering.
You need to provide a property in your items model that returns the name from the ID, instead of looking up the name in a converter.
I ended up using the [NotMapped] attribute to add extra properties to the entity using partial classes. I hope that the DataGrid sorting behavior will change in the future.
I ended up using the [NotMapped] attribute to add extra properties to the entity using partial classes.
Using entities as view models is an anti-pattern, you should strictly avoid this
I hope that the DataGrid sorting behavior will change in the future.
I don't think so, there is no more active feature development on WPF
Using entities as view models is an anti-pattern, you should strictly avoid this
i don't use entities as view models, i just use ObservableCollection of entity type inside my view-models
I don't think so, there is no more active feature development on WPF
In Fact WPF is still under development https://github.com/dotnet/wpf#status
if you set a converter on a DataGridTextColumn the filtering is not using the converted value, instead it will search using the binding property, if you use a converter to get the username for example from an int ID property, the search filter will ignore the converter so that if you type "john" for example it will search for "john" in a set of int values and no result return