ASPxVerticalGrid设置字段列和记录列宽度
在 ASPxVerticalGrid 中,字段列(Field Column)和记录列(Record Column)的宽度需要分别通过 Settings 下的两个不同属性来设置。

📏 设置字段列宽度(行标题区域)
字段列在垂直网格中表现为行标题,其宽度由 HeaderAreaWidth 属性控制。

属性:Settings.HeaderAreaWidth

默认值:200 (像素)

类型:Int32

示例代码 (ASPX):

aspx
<dx:ASPxVerticalGrid ID="grid" runat="server" ...>
    <Settings HeaderAreaWidth="250" />
    <!-- 其他设置 -->
</dx:ASPxVerticalGrid>

📐 设置记录列宽度
记录列(即每条数据记录对应的列)的宽度由 RecordWidth 属性控制。

属性:Settings.RecordWidth

默认值:0 (表示自动调整)

类型:Int32 (单位:像素)

示例代码 (ASPX):

aspx
<dx:ASPxVerticalGrid ID="grid" runat="server" ...>
    <Settings RecordWidth="180" />
    <SettingsEditing Mode="Batch" />
    <!-- 其他设置 -->
</dx:ASPxVerticalGrid>

⚠️ 重要注意事项
RecordWidth 属性仅在以下两种模式下生效:

批量编辑模式 (SettingsEditing.Mode="Batch")

水平滚动启用时 (Settings.HorizontalScrollBarMode 不为 Disabled)

如果未启用上述任一功能,网格会自动将记录宽度调整为适应控件总宽度的值,此时 RecordWidth 设置将被忽略。

💡 补充说明
列宽调整模式:在 ASPxGridView 中,可以通过 SettingsBehavior.ColumnResizeMode 属性控制列宽调整行为。ASPxVerticalGrid 的类似行为可能受其自身设置影响,但主要宽度控制仍依赖上述两个属性。

文本截断:如果单元格文本超出指定宽度,可以通过 SettingsBehavior.AllowEllipsisInText 属性启用省略号显示。

渝公网安备 50011902000225号

渝ICP备18008233号-1