2011-11-22 82 views
3

如何在radgrid中设置标题样式?RADGrid中的标题样式

以下是我怎么想设置字幕文本:

radExport.MasterTableView.Caption = "Reports"; 

回答

3

我相信你可以调整这样的造型:

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

这里的一些文档,讨论一下:
http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.gridtableview-caption.html

+0

我试过上面的代码。仍然不成功!任何其他指针? – RMN

+1

您应该按照提供的链接进行操作,并且您应该将'CssClass'设置为MasterTableView的MasterTable_Default,或者为每个明细表的MasterTableView将'CssClass'设置为'DetailTable_Default'。 –

0

您还可以编写自己的HTML代码,并通过导出按钮单击中的RadGrid.MasterTableView.Caption进行绑定。它可以是一个徽标或一些您希望在文件顶部显示的声明。

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; 

希望这会给你一个想法。