Hi There,
Hello Tamrika,
I have been investigating into this behavior that you are looking to achieve, and currently, the “FixedFieldButton” element that shows in the regular XamDataGrid is intentionally hidden if the parent LabelPresenter element exists in the FieldChooser and so Field fixing is not directly supported through the FieldChooser.
As a workaround to this, I would recommend inclusion of the default styles for LabelPresenter and FixedFieldButton so that you can modify them. These default styles exist in the DataPresenterGeneric.xaml file commonly found at the following directory:
C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\DataPresenter
Normally, I would just recommend that you remove the Setter that hides the FixedFieldButton if the LabelPresenter is in the FieldChooser, but while this does make the FixedFieldButton appear, its built-in commands do not work. As such, I would recommend that you add a secondary FixedFieldButton to the LabelPresenter’s template with the same settings as the one that already exists with the exceptions of the Visibility property, which should be collapsed by default and the Name. You can then add a Setter to the Trigger that targets the IsInFieldChooser property that marks this FixedFieldButton’s Visibility as visible.
I would also recommend that you add an x:Key to the FixedFieldButton’s default style that you bring in. Doing this will ensure that you can use a modified version of this style with your extra FixedFieldButton, which will allow you to place a custom Command or Click event on the MenuItems that exist in the FixedFieldButton’s default style. The CommandParameter here does not need to change, as it is still the Field that the FixedFieldButton is placed on, but the actual Command is not currently configured to work with the FieldChooser, and so I would recommend supplying your own. In doing so, you can get the Field that is passed in as the CommandParameter and toggle its FixedLocation property.
I have attached a sample project that demonstrates the above. I hope it helps you.
It is worth noting that the above is sort of a hack in order to avoid a current limitation of the XamDataGrid, and so if you would like to see Field fixing be directly implemented through the FieldChooser, I would recommend suggesting a new product idea for this feature by e-mailing ideas@infragistics.com. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Please let me know if you have any other questions or concerns on this matter.
XDGPinButtonFieldChooser.zip
Sincerely,AndrewSoftware Developer