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
|
Hello, How can I customize the template used in the DataGrid Cell validation (i.e. the Red Border)? Is there a validation template property I can set? Thank You Oscar |
|
|
Hi Oscar, There is no property that you can set, but you can create a custom cell style to customize how you want the validation border to look - and also anything else you may want to customize. Find one of the DataGrid template xaml files in the WPF Elements install directory. OfficeBlue.DataGrid.xaml for example will have the cell template and style code from line 682 to 825. There are 3 cell templates - a simple one just used for displaying content, a heavier one with additional UI elements for mouse over, highlighted, selection and validation visuals, and another one containing an expandable button for hierarchical data - you probably don't need this one if you never have hierarchical data in a DataGrid. Copy what you need to your own resource dictionary. Find DataGridCellNotValidBorder and make whatever customizations you want. You'll also need to create a custom DataGridRow style. All you need to do there is set the ItemsContainerStyle property to be your custom cell style. -Jason Fauchelle |
|