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
|
There is a DataGrid.SetCellBackground(DataGridCell, Brush) method...could we get a DataGrid.SetCellForeground(DataGridCell, Brush) method? Also, I would love to have a way to control common cell properties (i.e. background, foreground, font, etc.) through a style. I commonly use different representations of information in the DataGrid to help the user quickly see the items that are editable or not. For example, I'll set the foreground color on all the cells that are editable. I'm hoping for something similar to the following:
What would really be nice is if the DataGridCell/DataGridCellContainer had a property for the row content. I'd really like to be able to do something like the following:
Hopefully, this makes sense. I'd like to easily tailor the look of the individual cells and base it on my underlying model information. Thanks! |
|
|
Hello Jared Are you still using custom display and editor templates on the columns? The data context of these templates are the row content objects. (your model objects). So if you put properties such as IsEditable on your row content objects, you will be able to access them in your custom templates and use triggers to change the foreground and background etc of whatever controls/UI elements you're using in the template. With this in mind, you shouldn't need a SetCellForeground method. Let me know if you need assistance. Jason Fauchelle |
|
|
I can make this work just fine using custom display and editor templates. I was really looking for a way to quickly apply some cell level styling across the entire DataGrid particularly for the instances where I'm not using custom display and editor templates (just relying on the DisplayMemberBinding). Thanks. |
|
|
Hello Jared A way to provide common cell styling logic would be very useful. I've noted this down as a future enhancement. Thanks for this feedback. Jason Fauchelle |
|
|
Thanks! |
|