简体   繁体   中英

asp.net c# detailview how to set column width

I have a problem with setting column width to the detailview. Tried different options like headerstyle with and fieldstyle width. But none of them seems to work.

在此输入图像描述

使用FieldHeaderStyle-Width =“400px”来控制第一个标题列的宽度。

Plz Try it.

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
        CellPadding="4" DataKeyNames="C_id" DataSourceID="EntityDataSource1" 
        ForeColor="Blue" Height="100px" Width="100%" AllowPaging="True">
        <AlternatingRowStyle BackColor="White" ForeColor="Red" />
        <CommandRowStyle BackColor="Blue" Font-Bold="True" />
        <EditRowStyle BackColor="#999999" />
        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" Width="40%"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM