Dynamically Setting Background Colour of RadTileViewItem Header

5 posts, 1 answers
  1. Naren
    Naren avatar
    53 posts
    Member since:
    Aug 2010

    Posted 18 Nov 2010 Link to this post

    Hi Miro Miroslavov ,
    you replyed me in the post with following link

    The solution you provided show customization for static tile view(Tile view declared in Xaml).
    I want customization for tile view created at runtime in code........

    I am creating RadTileView at runtime as follows

    public MainPage()
                // Required to initialize variables
    RadTileView myTView = new RadTileView();

               RadTileViewItem myTileViewItem = new RadTileViewItem();
                myTileViewItem.Header = "My Header";

    How can i set header background color of myTileViewItem to Green in code .

    can you  provide solution for above...
    Thanks in advance
  2. Answer
    Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 18 Nov 2010 Link to this post

    Hi Naren,

    The solution Miroslav has provided will work even if you define the items dyncamically. Please have a look at the attached project (tileviewheader.zip).

    However, if you want to set custom color to each tile item separately, you need to take a look at the second attached project (tileviewcustomcolor.zip).

    All the best,
    Kiril Stanoev
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Naren
    Naren avatar
    53 posts
    Member since:
    Aug 2010

    Posted 19 Nov 2010 Link to this post

    Thank you that was helpful......
  4. GM72
    GM72 avatar
    23 posts
    Member since:
    Sep 2012

    Posted 12 Jan 2011 Link to this post

    The solution to set the colour of the header doesn't work as item.ChildrenOfType<Border>() is always = 0 when I try this?
  5. Petar Mladenov
    Petar Mladenov avatar
    3164 posts

    Posted 14 Jan 2011 Link to this post

    Hello Naren,

    Are you sure you haven`t missed the dispatcher from the sample? It is mandatory in this case, since it ensures that the visual containers have been generated.

    All the best,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top