Hi Infragistics-Team,
I want to overwrite or retemplate the FieldChooser, because I need an extra column where the user can change the column-width.
How can this be done - do you have an example of how to set the itemstemplate?
Best regards
Markus
Hello Markus,
Thank you for your post.
To set the template of the items in the XamDataGrid's FieldChooser, I would first recommend that you navigate to and open the DataPresenterGeneric_Express.xaml file commonly found at the following directory: C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\DataPresenter. Inside of this XAML file, you will find a Style for FieldChooser. This Style will have a DataTemplate targeting the FieldChooserEntry element inside of its Resources collection. This is what you will need from this file, and I would recommend that you pull it into your project.
Once you have placed this default DataTemplate for FieldChooserEntry into your project, you can modify the contents of the CardPanel inside of that template to include your TextBox that will determine the width of the corresponding Field. The data context of the elements that exist inside of this template will have a reference to the Field in which each item represents, and so you can bind the TextBox's Text property to {Binding Field.Width} to display the width of your Field inside of your textbox.
I have attached a sample project to demonstrate how this can be achieved. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Thank you Andrew,
exactly what I need. Also thanks for the hint where the Templates can be found.
Have a nice weekend,