【问题标题】:ASP Edit GridView StyleASP 编辑 GridView 样式
【发布时间】:2018-04-29 08:59:08
【问题描述】:

使用here 发布的示例,我一切正常。问题是风格。当 gridview 加载时,它看起来很棒。我按编辑,字体、列高、宽度等都发生了变化。当按下 EDIT 按钮时如何编辑样式以在加载时看起来与以前的样式完全相同?

<asp:GridView ID="GridView1" runat="server" DataKeyNames="CustomerId" OnRowDataBound="OnRowDataBound" OnRowEditing="OnRowEditing" OnRowCancelingEdit="OnRowCancelingEdit" OnRowUpdating="OnRowUpdating" OnRowDeleting="OnRowDeleting" EmptyDataText="No records has been added." AutoGenerateEditButton="true" AutoGenerateDeleteButton="true">
</asp:GridView>

【问题讨论】:

    标签: css asp.net gridview styles


    【解决方案1】:

    你可以使用gridview本身:

    <asp:GridView ID="GridView1" runat="server">
        <EditRowStyle BackColor="Green" />
    </asp:GridView>
    

    使用带有样式表的gridview:

    <asp:GridView ID="GridView1" runat="server">
        <EditRowStyle CssClass="myClass" />
    </asp:GridView>
    

    或使用样式表:

    #GridView1 input { width: 100%; }
    

    【讨论】:

    • 您可能需要进行一些试验才能使其看起来完全一样。
    • 感谢您的反馈。这对我有用......有点玩。
    猜你喜欢
    • 2018-05-01
    • 2012-01-16
    • 1970-01-01
    • 2011-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-20
    • 2014-08-18
    相关资源
    最近更新 更多