3

How can we set style for caption in radgrid?

Following is how I am trying to set the caption text:

radExport.MasterTableView.Caption = "Reports";
Tony L.
  • 17,638
  • 8
  • 69
  • 66
RMN
  • 754
  • 9
  • 25
  • 45

3 Answers3

3

I believe you can adjust the styling like this:

<style type="text/css">
    .MasterTable_Default caption {
        color: red;
        }   
    .DetailTable_Default caption {
        color: blue;
        }
</style>

Here's some documentation that talks about it:
http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.gridtableview-caption.html

James Johnson
  • 45,496
  • 8
  • 73
  • 110
  • 1
    You should follow link provided and you should set `CssClass` to `MasterTable_Default` for master `MasterTableView` or/and set `CssClass` to `DetailTable_Default` for every detail tables's `MasterTableView` . – Michał Kuliński Jul 05 '12 at 15:13
0

If you want to add style while only when exporting take a look at this

BFigueiredo
  • 176
  • 1
  • 7
0

You can also write your own HTML code and bind through RadGrid.MasterTableView.Caption at the Export Button Click. It can be a logo or some statement that you would like to have it at the top of the file.

string firstHeaderLine = "<div id='master' style='color:black; text-align:left;'>Company Name: XYZ</div>";
firstHeaderLine += "<div id='master' style='color:black; text-align:left;'>Date Report Generated: " + DateTime.Now.ToShortDateString() + "</div>";
firstHeaderLine += "<div id='master' style='color:black; text-align:left;'>Report Generated by: XYZ </div>";
RadGrid1.MasterTableView.Caption = firstHeaderLine;

Hope this will give you an idea.

memz
  • 45
  • 11