文本对齐网格视图中的更改

时间:2015-08-10 08:18:05

标签: c# asp.net c#-4.0 gridview

以下网格视图有一个包含三个单元格的记录。这些单元格是日期,名称和视图。当name是长名称(超过200个章程)时,记录高度会更改并影响日期对齐。如何在其单元格的上侧保持日期对齐?

<asp:GridView ID="GridView2" runat="server" Width="100%" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" GridLines="None" CellPadding="4" ForeColor="#333333">
    <alternatingrowstyle backcolor="White" />
        <columns>
            <asp:boundfield datafield="eventDate" sortexpression="eventDate" itemstyle-width="30px" controlstyle-font-underline="true" dataformatstring="{0:dd/MM/yyyy}">
                <controlstyle font-underline="True"></controlstyle>
                    <itemstyle width="30px"></itemstyle>
            </asp:boundfield>
            <asp:boundfield datafield="eventName" sortexpression="eventName" controlstyle-font-underline="true">
                <controlstyle font-underline="True"></controlstyle>
            </asp:boundfield>
            <asp:templatefield itemstyle-horizontalalign="Center">
                <itemtemplate>
                    <asp:LinkButton ID="lnkView" runat="server" Text="More" OnClick="View2" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                </itemtemplate>
                <itemstyle horizontalalign="Center"></itemstyle>
            </asp:templatefield>
        </columns>
    <editrowstyle backcolor="#2461BF" />
    <footerstyle backcolor="#507CD1" font-bold="True" forecolor="White" />
    <pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center" />
    <rowstyle backcolor="#EFF3FB" font-underline="False" forecolor="#FF3300" />
    <selectedrowstyle backcolor="#D1DDF1" font-bold="True" forecolor="#333333" />
    <sortedascendingcellstyle backcolor="#F5F7FB" />
</asp:GridView>

0 个答案:

没有答案