【问题标题】:Grid display changes on re binding the grid重新绑定网格时网格显示更改
【发布时间】:2012-09-17 12:23:19
【问题描述】:

我的 aspx 页面上有一个网格。我已将其字体属性设置为小.. 在页面加载时一切正常.. 但是一旦我执行了一些动作,比如在网格本身中给出的删除活动......并且通过调用绑定网格的方法再次绑定网格...... 大字体的网格似乎更大。 有什么问题?

          <asp:GridView ID="grdSMEList" runat="server" Width="100%" BorderWidth="1px" BorderStyle="Solid"
        Font-Size="Small" AutoGenerateColumns="False" BorderColor="#ffcc00" RowStyle-BorderColor="#ffcc00"
        AllowPaging="true" PageSize="10" OnPageIndexChanging="GrdDynamic_PageIndexChanging"
        DataKeyNames="Resource Personnel No" OnRowCommand="GrdDynamic_RowCommand" RowStyle-BorderStyle="Solid"
        RowStyle-BorderWidth="1px" GridLines="Both" Height="104px">
        <PagerSettings NextPageText="&amp;gt;&amp;gt" PageButtonCount="5" PreviousPageText="&amp;lt;&amp;lt"
            FirstPageText="" LastPageText="" Mode="Numeric" />
        <PagerStyle HorizontalAlign="Right" Font-Size="Medium" />
        <Columns>
            <asp:BoundField DataField="Resource Personnel No" HeaderText="Resource Personnel No" ItemStyle-Width="100px" />
            <asp:BoundField DataField="RES Name" HeaderText="ResourceName" ItemStyle-Width="100px" />

            <asp:TemplateField HeaderText="Deactivate" >
                <ItemTemplate>
                    <div style="text-align:center;">
                        <asp:LinkButton ID="linkDeactivate" CommandName="cmdDeactivate" OnRowCommand="GrdDynamic_RowCommand"
                            CommandArgument='<%# Eval("Resource Personnel No") %>' OnClientClick="return confirm('Are you sure you want to Deactivate?');"
                            runat="server">Deactivate</asp:LinkButton>
                    </div>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="2%" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

【问题讨论】:

    标签: asp.net .net gridview


    【解决方案1】:

    您是否尝试在 ItemTemplate 中指定字体颜色?值得一试。

    【讨论】:

      猜你喜欢
      • 2012-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-07
      • 2019-12-19
      • 2013-12-20
      相关资源
      最近更新 更多