如何仅突出显示GridView标头中的两个特定/特定单元格? [英] How to highlight just two specific/certain cells in the header of the GridView?

查看:50
本文介绍了如何仅突出显示GridView标头中的两个特定/特定单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个GridView,在GridView的标题中有7列或单元格.我只想突出显示标题中的Cell#3和Cell#4,而没有每个单元格下面的数据. 该怎么做?

I have a GridView that has 7 columns or cells in the header of the GridView. I just want to highlight the Cell#3 and Cell#4 in the header without the data below each cell. HOW TO DO THAT?

推荐答案

使用列的标题样式
Use Header style of column
 <asp:boundfield datafield="taskid" headertext="Assignment No." xmlns:asp="#unknown">
                            InsertVisible="False" ReadOnly="True" SortExpression="taskid" HeaderStyle-BackColor="Aqua" />
</asp:boundfield>


像这样
<asp:gridview id="grd" runat="server" autogeneratecolumns="false" xmlns:asp="#unknown">
    <columns>
    <asp:boundfield datafield="ID" />
    <asp:boundfield datafield="First_Name" />
    <asp:boundfield datafield="Department" headerstyle-backcolor="Blue" />
    <asp:boundfield datafield="Designation" headerstyle-backcolor="Maroon" />
    </columns>
    </asp:gridview>


这篇关于如何仅突出显示GridView标头中的两个特定/特定单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆