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

[Solved] FooterText Style set partially

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 21 May 2013, 09:22 AM
I need to show footerText like "Total Count: 10'. Number "10" should be highlighted with color red.
I have set Aggregate="Sum", FooterText="Total Count: ". 

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 21 May 2013, 10:31 AM
Hi,

Please try the following code snippet to change the color of the Footer text.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridFooterItem)
        {
            GridFooterItem footeritem = (GridFooterItem)e.Item;
            string value = footeritem["UniqueName"].Text.Split(':')[1];
            footeritem["UniqueName"].Controls.Add(new LiteralControl("Total Count:" + "<span style='color: Red; font-weight: bold;'>" + value + "</span> "));
        }
}

Thanks,
Princy
0
James
Top achievements
Rank 1
answered on 21 May 2013, 10:42 AM
hi Princy,

Thanks for you help.

Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
James
Top achievements
Rank 1
Share this question
or