Diference between Palette and DataTemplate

2 posts, 0 answers
  1. Thiago
    Thiago avatar
    16 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    Hi,
    I´ve found on documentation the Palettes topic. 
    I want to know what´s the diference between the use of palettes and data templates.
    I was using data templates with predefined colors, in this case, each new item was receiving a data template.
    For sample, in the bar series, my data template is a rectangle with your color.
    Can I use Palettes for substitute it? 

    Thanks in advance,
    Thiago
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 28 May 2012 Link to this post

    Hi Thiago,

    Thank you for writing.
    The difference between the palettes and the data templates is that a Palette only allows you to set stroke and fill, that is, just colors. On the other hand, a DataTemplate is the Silverlight/WPF way of specifying a whole visual tree. When you specify a DataTemplate you can put rectangle inside, a border over the rectangle, a label or any other visual element you can think of. A DataTemplate allows you to completely define the visualization of your data points. The palette only allows you to specify colors.

    If you are using the data templates to only define colors, you should be able to replace them with palettes. However, if you have custom visual elements inside the data templates you will not be able to replace them with palettes.

    Please write again if you have other questions.

    Regards,
    Victor
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top