【问题标题】:Gridview header formattingGridview 标题格式
【发布时间】:2014-01-19 01:23:19
【问题描述】:

我有一个GridView。我没有在其中添加任何 style ,但它仍然给我蓝色标题标签。我该如何解决它。

我的GridView 如下。

<asp:GridView ID="grdViewApp" runat="server" AutoGenerateColumns="False" DataKeyNames="APPLICATION_ID,APPNAME,APPDESCRIPTION,REMARKS,VERSION,SCHEDULE_ID,AUTHENTICATION_TYPE"
                            BorderStyle="None" BorderWidth="0px" Width="100%" BorderColor="Transparent" OnRowCommand="grdViewApp_RowCommand"
                            OnSorting="grdView_Sorting"  AllowSorting="true"  AllowPaging="true" PageSize="4"
                            OnPageIndexChanging="grdViewApp_PageIndexChanging" OnRowDataBound="grdViewApp_RowDataBound">
    <AlternatingRowStyle CssClass="AltRow" />
    <HeaderStyle HorizontalAlign="Left" />
    <RowStyle CssClass="Row" />                                
    <Columns>
        <asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="left" ItemStyle-Width="5%">
            <HeaderStyle HorizontalAlign="Left" />
            <ItemTemplate>
                <asp:ImageButton ImageUrl="~/images/edit-icon.png" ID="ImgBtnEditApp" runat="server"
                                            Height="18" Width="18" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'
                                            CommandName="EditApp" title="Edit Record"  />
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center" Width="5%" />
        </asp:TemplateField>

        <asp:BoundField DataField="APPLICATION_ID" HeaderText="ID" ReadOnly="True" SortExpression="APPLICATION_ID">
            <ItemStyle Width="15%" HorizontalAlign="Left" />
        </asp:BoundField>

        <asp:BoundField DataField="AppName" HeaderText="Names" SortExpression="AppName">
            <ItemStyle Width="15%" HorizontalAlign="Left" />
        </asp:BoundField>

        <asp:BoundField DataField="AppDescription" HeaderText="Description" SortExpression="AppDescription">
            <ItemStyle Width="15%" HorizontalAlign="Left" />
        </asp:BoundField>

        <asp:BoundField DataField="Version" HeaderText="Version" SortExpression="Version">
            <ItemStyle Width="15%" HorizontalAlign="Left" />
        </asp:BoundField>
    </Columns>
 </asp:GridView>

【问题讨论】:

    标签: html asp.net gridview


    【解决方案1】:

    网格使用表格元素作为标题,此外,由于您启用了排序,它还使用带有链接的标题文本,因此样式很可能来自标题链接。您必须使用 CSS 来设置链接的样式以使用另一种颜色。

    【讨论】:

      猜你喜欢
      • 2011-12-29
      • 1970-01-01
      • 2019-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-26
      相关资源
      最近更新 更多