This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi I'd like to use DisplayName for the column headings in a DataGrid but it appears as though this only works for autogenerated columns. If I set AutoGenerateColumns to false and specify the columns I want, then I have to set the header in each. Correct? It would be nicer if the columns used the DisplayName unless I override them with Header in the DataGridColumn. Cheers |
|
|
Hello The easiest way to specify a column is to add a DataGridColumn to the DataGrid.Columns collection and set the PropertyName property. If you set the PropertyName of a column to be a name of a property on your model object then the column will automatically set the Header, EditorTemplateSelector and DisplayTemplate. If this does not resolve your issue, please send us some code showing how you are specifying the columns, then we'll see if we can add some more convenience here. Jason Fauchelle |
|
|
Hi My model looks like this:
The grid is as follows:
But the WorkingSet columns still displays "WorkingSet" for the header. However, in the designer it is picking up the DisplayName attribute - just not at runtime. I can send you the whole app if you like, nothing secret in it. Send me your email address if you want it. Cheers |
|
|
Hello Jonesie Thanks for sending this code! The next nightly build will include support for the DisplayName attribute when specifying the columns. Jason Fauchelle |
|
|
This is exactly why I'm happy to give you guys money. You rock! Cheers |
|