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

[Solved] Grid Footer Text alignment

2 Answers 319 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 04 Jun 2009, 02:33 PM
I have a GridFoterItem in my ItemDatabound and it works great.  The only issue I have with it is that I don't know how to align the text to the right instead of the default left. Below is what I have any help would be great!  Thanks!

 

GridFooterItem footerItem = e.Item as GridFooterItem;

 

footerItem[

"person"].Controls.Add(new LiteralControl("<strong>Total</strong><br/>"));

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Jun 2009, 05:11 AM
Hi Mike,

You may set the Horizontal alignment of the footer either in the aspx or code behind as shown below.

ASPX:
 
              <FooterStyle  HorizontalAlign="right" /> 

CS:
 
   GridFooterItem footerItem = (GridFooterItem)e.Item; 
   footerItem["person"].HorizontalAlign = HorizontalAlign.Right; 
   footerItem["person"].Controls.Add(new LiteralControl("<strong>Total</strong><br/>"));  


Regards
Shinu



0
Mike
Top achievements
Rank 1
answered on 05 Jun 2009, 12:37 PM
That did the trick, thank you!
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Share this question
or