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
|
Can I customize certain columns in the WPF DataGrid to display custom indicators, like the sparklines or range lines you see in the attached sample image? If not right out of the box, how would you recommend to go about doing this with your grid? |
|
|
We do indeed have an example available in a blog post from a while back - check it out here: http://www.mindscapehq.com/blog/index.php/2012/1/23/datagrid-customization-with-elements-5-sparklines-template-selectors-and-more/. Hopefully this can get you close to your desired effect. |
|
|
That's great! Thank you. How would I go about doing the "Range" column. Just general guidelines is fine. |
|
|
Hello Nestor Just like the sparklines, you'd make a data template to set the DisplayTemplate of the ranges column. The data template would read the logic values of the objects in the column to create the range lines. This would include a horizontal centered line, and the 2 colored dots. The position of the dots could be controlled by converters. These would probably need to be multi converters which would take the logical values as well as the ActualWidth of the line to calculate the positions of the dots. The converters could be used to control either the RenderTransform or the Margin property of the dots - whichever you find easiest. Alternatively, you could create a simple custom Control/UIElement that includes the dot positioning logic, and then add an instance of this control to the data template. Let us know if you need further assistance. Jason Fauchele |
|