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,
I Added Up/Down arrow button to the fieldchooser to move the selected item but when I click on the item is not selected amd I want the click item to be selected and remain selected and highlighted when I am moving the item
LabelPresenter has IsSelectedInFieldChooser will I able to set this property when I click on the item?
Thank you for your response. I am glad that I was able to help you to customize the FieldChooser.