Vertical Grid概念Concepts

本文介绍了DevExpress垂直网格控件的不同布局风格,包括BandsViewLayout、SingleRecordViewLayout和MultipleRecordsViewLayout,并详细解释了每种布局的特点及如何在设计时和代码中更改布局。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Layouts

布局

 

The VerticalGridControl (VGridControl) allows you to represent unrderlying data using different formats - layouts. Layouts differ in the number of records they display at a time and in the way they are arranged. This topic demonstrates how to change a layout and briefly explains the differences between each layout. Each layout is described in detail in its own separate topic (links are provided).

The PropertyGridControl supports only one layout, which is equivalent to the Single Record View Layout used in the VerticalGridControl. The PropertyGridControl does not support horizontal scrolling.

How to Change the Layout

The layout currently applied to a VGridControl control is specified by its VGridControl.LayoutStyle property. The image below demonstrates how the layout can be changed at design time.

The same can also be done in code:

C#
VB
vGridControl1.LayoutStyle = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView;
vGridControl1.LayoutStyle = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView
C#
vGridControl1.LayoutStyle = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView;
VB
vGridControl1.LayoutStyle = DevExpress.XtraVerticalGrid.LayoutViewStyle.SingleRecordView

As can be seen from the above image there are three different layout styles which can be applied to a vertical grid control. These layout styles are listed below:

  • Bands View Layout

    When this layout is applied to the control, a single record is displayed at a time. If there are too many fields to fit into the control's area then the records are arranged into columns - bands. This layout is likely to be used if you have a large number of fields to display and want them all to be visible within a grid.

  • Single Record View Layout

    This layout also displays a single record at a time. The difference with the Bands View layout is that the record isn't arranged into columns if it exceeds the control's height. Row headers together with record values occupy the entire grid's width. This layout is likely to be useful if you need to display only a small number of fields and you want to disable standard navigation through records (custom navigation can be implemented). For instance, a single record from the data source can be displayed to each user (e.g. the users of your application can see only their details unless they have extended permissions).

  • Multiple Records View Layout

    Apply this layout to the control to display multiple records within a grid. This type of layout is likely to be useful if you need to display only a small number of fields and want to provide easy navigation through the records to your end-users.

Scrolling through Records in Different Layouts

Basically, there are three ways in which end-users can navigate through records: using the left and right arrow keys, the mouse wheel or the horizontal scrollbar. However, not all of these navigation methods are supported by each type of layout. The list below describes the methods that are available for scrolling through the records in each layout and explains how they can be enabled or disabled, as well as providing information on how each navigation method works with each particular layout style.

  • Moving focus from record to record using the left and right arrow keys. The table below shows how this type of navigation depends upon the layout applied.

Layout StyleDescription
Bands View LayoutKey navigation through the records is disabled. Left and right arrow keys are used to navigate through the bands in this case.
Single Record View LayoutKey navigation is enabled only when the horizontal scrollbar is displayed.
Multiple Records View LayoutKey navigation through the records is always enabled.
NoteNote

Navigation through the records in Bands View and Single Record View layout is allowed if the horizontal scrollbar is shown. Otherwise, end-users cannot navigate through the records. The horizontal scrollbar's visibility is specified by the VGridControlBase.ScrollVisibility property.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值