简体   繁体   English

asp.net c#detailview如何设置列宽

[英]asp.net c# detailview how to set column width

I have a problem with setting column width to the detailview. 将列宽设置为detailview时出现问题。 Tried different options like headerstyle with and fieldstyle width. 尝试了不同的选项,如headertyle和fieldstyle width。 But none of them seems to work. 但它们似乎都不起作用。

在此输入图像描述

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

Plz Try it. Plz试一试。

<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%"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.net 将宽度设置为存储在 c# 中的值 - ASP.net set width to value stored in c# ASP.NET - 如何在C#表上设置Cells-Width-Percentage - ASP.NET - How to set Cells-Width-Percentage on C# Table 如何将HyperLinkField NavigateURL设置为SQL列值C#ASP.Net Web窗体 - How to set HyperLinkField NavigateURL to SQL Column Values C# ASP.Net Web Forms ASP.NET (C#) 中的 DetailView 在编辑模式下使用下拉列表将主键推送到数据库 - DetailView in ASP.NET (C#) in Edit Mode using DropDown list pushing Primary Key to Database 如何设置背景无颜色ASP.NET C# - How To Set Background None Color ASP.NET C# c# - 如何在asp.net中设置特定的控件识别? - c# - how to set specific control indentification in asp.net? 如何在C#代码中而不是ASP.net中设置OnSelectedIndexChanged - how to set the OnSelectedIndexChanged in C# codebehind instead of ASP.net ASP.net/C#新手寻找在检索数据时动态编辑列宽的帮助 - ASP.net/C# newbie looking for help editing column width dynamically when data is retrieved 在HTML / ASP.Net上设置DataGridView列的Width - Set DataGridView column Width on HTML/ASP.Net 无法将ASP.Net Gridview模板列宽设置为0 - Can not set ASP.Net Gridview Template Column width to 0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM