FooterAggregateFormatString Set Different Color

4 posts, 1 answers
  1. New
    New  avatar
    25 posts
    Member since:
    Jul 2012

    Posted 18 Dec 2012 Link to this post


    How to set the different color for FooterAggregateFormatString show value

    and one more doubt how to set different color for every level

    reply as soon as possible .

    Thanks Advance,
    Mohamed.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Dec 2012 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    C#:
    protected void RadTreeList1_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
    {
        if (e.Item is TreeListFooterItem)
        {
            TreeListFooterItem item = (TreeListFooterItem)e.Item;
            if (item.HierarchyIndex.NestedLevel == 0)
            {
                item["UniqueName"].ForeColor = System.Drawing.Color.Red;
            }
            else if (item.HierarchyIndex.NestedLevel == 1)
            {
                item["UniqueName"].ForeColor = System.Drawing.Color.Green;
            }
        }
    }

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. New
    New  avatar
    25 posts
    Member since:
    Jul 2012

    Posted 20 Dec 2012 Link to this post


    Thanks for reply princy

    I want to differentiate the every level of tree list ,
    How i set the color

    Thanks Advance ,
    Mohamed.
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Dec 2012 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    C#:
    protected void RadTreeList1_ItemDataBound(object sender, TreeListItemDataBoundEventArgs e)
    {
        if (e.Item is TreeListDataItem)
        {
            TreeListDataItem item = (TreeListDataItem)e.Item;
            if (item.HierarchyIndex.NestedLevel == 0)
            {
                item.BackColor = System.Drawing.Color.Red;
            }
            else if (item.HierarchyIndex.NestedLevel == 1)
            {
                item.BackColor = System.Drawing.Color.Green;
            }
        }
    }

    Hope this helps.

    Regards,
    Princy.
Back to Top