I created a TemplateColumn which displays information of a customer in TextBlocks in a StackPanel. The Column itsself binds to the customer object. If I open the filter menu, now values are displayed in the Editor. Sometimes different TextBlocks in the cells are collapsed. I now created a customer sorter and a custom group by comparer to fix sorting and grouping.
How can I fix the FilterDialog? Is there any option to use the .ToString() result of the customer object for the FilterDialog. Or any option to tell it a property to use?
Hello Tobias,
Thank you for your post.
I have been looking into it. I created a sample application based on your scenario. I am not sure that I completely understand your requirements and your issue. Could you please modify the attached sample application with the functionality, that you are using, so it reproduces the issue. This way I would be able to further investigate this for you and provide you with more detailed information on this matter. If you want to create a custom filter, I can suggest you to take a look at the following forum thread : http://www.infragistics.com/community/forums/t/67515.aspx
Looking forward to hearing from you.
I'm working on a WPF-Project
My classes look look like this:
class Customer { public string Lastname { get; set;} public string Firstname { get; set;}}
class ListItem { public int ID { get; set; } public Customer Customer { get; set; }}
My XamGrid like this:
<ig:XamGrid ItemsSource="{Binding ListOfListItems}"> <ig:XamGrid.Columns> <ig:XamGrid.TemplateColumn Key="Customer"> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"><TextBlock Text="{Binding Value.Lastname}" FontWeight="Bold"/><TextBlock Text="{Binding Value.Firstname}"/></StackPanel> </DataTemplate> </ig:TemplateColumn.ItemTemplate/> </ig:XamGrid.TemplateColumn> </ig:XamGrid.Columns></ig:XamGrid>
The Column itsself is filled correctly with the customer object, and the data is displayed correct. But Filter-Editor does not contain any data.
Thank you for your reply.
I have been looking into the code snippet that you have provided and I created sample application based on your description and classes. I could not managed to reproduce the behavior that you have described. If you are not able to reproduce the issue with the attached sample application, would you please modify it with the functionality, that you are using, so it reproduces the issue. This way I would be able to further investigate this for you and provide you with more detailed information on this matter.
Ok, the main difference is, that I would use "Customer" as Key for my column, and you are using "Customer.Firstname". If you change your key to "Customer", you could reproduce my problem. I didn't know, that allthough you are using a property of the customer as key, you still have access to the customer object in the column.
So with this new information I think I might be able to change my code, so that everything is working fine.
Thanks for your help.
Thank you for your feedback. I am glad that my suggestion was helpful for you and I believe that other community members may benefit from this as well.
If you require any further assistance, please do not hesitate to ask.