This is a migrated thread and some comments may be shown as answers.

FooterAggregateFormatString Set Different Color

3 Answers 108 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
New
Top achievements
Rank 1
New asked on 19 Dec 2012, 05:16 AM

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.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 19 Dec 2012, 10:23 AM
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.
0
New
Top achievements
Rank 1
answered on 20 Dec 2012, 09:55 AM

Thanks for reply princy

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

Thanks Advance ,
Mohamed.
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Dec 2012, 11:33 AM
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.
Tags
TreeList
Asked by
New
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
New
Top achievements
Rank 1
Share this question
or