Is there a "smart labeling" option in XamDataGrid that will turn underscores "_" into spaces and capitalize the first letter of each word?
ex. account_id to Account Id
I've seen this functionality with other 3rd party controls in the past, but not sure where it exists within XamDataGrid.
If not, is there a way I can intercept the population of each auto-generated field header's "onbound" event to inject my custom logic while conforming to the MVVM pattern?
Hello Patrick,
Thank you for choosing Infragistics.
I have been looking into your issue and I have prepared a sample application for you to test if the desired effect is achieved.
In regards to the labeling option you have described, please note that the XamDataGrid does not introduce a functionality of that kind by default. An approach I can suggest you use is to handle the FieldLayoutInitialized event of the XamDataGrid and to manually iterate through the Fields of the current FieldLayout. This way you should be able to use the ToTitleCase method of the TextInfo class in order to capitalize each word of the string and you can also use the Replace method of the String class in order to replace the underscore characters with a space.
You can also take a look at the LabelTextAlignment, LabelTextTrimming and LabelTextWrapping methods of the XamDataGrid's FieldSettings for any further manipulation over the Fields' Labels.
http://help.infragistics.com/Help/Doc/WPF/2016.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v16.1~Infragistics.Windows.DataPresenter.FieldSettings~LabelTextAlignment.html
http://help.infragistics.com/Help/Doc/WPF/2016.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v16.1~Infragistics.Windows.DataPresenter.FieldSettings~LabelTextTrimming.html
http://help.infragistics.com/Help/Doc/WPF/2016.1/CLR4.0/html/InfragisticsWPF4.DataPresenter.v16.1~Infragistics.Windows.DataPresenter.FieldSettings~LabelTextWrapping.html
If you require any further assistance on this matter, please do not hesitate to ask.
Awesome thank you for the response! This solves my issue, but is there a way to tie into your XDG_FieldLayoutInitialized method using MVVM?