This lesson will guide you through the steps needed to select columns displayed in the List View. For this purpose, the Contact List View will be used. At runtime, you can right-click a column header and activate the Column Chooser, then drag invisible columns from the Column Chooser window to the grid control. To set the default table layout, you need to customize it at design-time.

本课将指导您完成选择列表视图中显示的列所需的步骤。为此,将使用联系人列表视图。在运行时,您可以右键单击列标题并激活列选择器,然后将不可见的列从列选择器窗口拖动到网格控件。要设置默认表布局,需要在设计时对其进行自定义。

Note 注意
Before proceeding, take a moment to review the Place an Action in a Different Location lesson.

在继续之前,请花点时间复习"将操作置于不同位置"课程。

In a WinForms application, the customizations made using the Runtime Column Chooser are persisted in a Model.user.xafml file, located in the application folder by default. In an ASP.NET application, you may need to set the SaveListViewStateInCookies property of the Options node and the SaveStateInCookies property of the corresponding Views | <ListView> node to "true". This enables you to save the List View state between sessions in a user's browser cookies, allowing each end-user to customize the List View individually. The set of columns visible by default is generated based on rules described in the List View Column Generation article. Customizing the default column set may be required. To make required columns visible or invisible within the List View by default, use the Model Editor.

在 WinForms 应用程序中,使用运行时列选择器进行的自定义将保留在默认情况下位于应用程序文件夹中的 Model.user.xafml 文件中。在ASP.NET应用程序中,您可能需要设置选项节点的"存储列表"InCookies 属性和相应视图的 SaveStateInCookies 属性 |<ListView>节点"true"。这使您能够在用户的浏览器 Cookie 中的会话之间保存列表视图状态,从而允许每个最终用户单独自定义列表视图。默认情况下可见的列集基于列表视图列生成文章中描述的规则生成。可能需要自定义默认列集。要使所需列在默认情况下在列表视图中可见或不可见,请使用模型编辑器。

  • Invoke the Model Editor for the MySolution.Module project, and navigate to the Views | MySolution.Module.BusinessObjects | Contact_ListView | Columns node to invoke the Grid List Editor Designer. It will display the default structure of the List View. You can customize the default appearance of the List View by dragging, resizing and grouping the columns. Invoke the Customization window by right-clicking the table header and selecting Column Chooser.

  • 调用 MySolution.模块项目的模型编辑器,并导航到视图 |My解决方案.模块.业务对象 |Contact_ListView |列节点以调用网格列表编辑器设计器。它将显示列表视图的默认结构。您可以通过拖动、调整大小和分组列来自定义列表视图的默认外观。通过右键单击表标题并选择"列选择器"来调用自定义窗口。

  • For example, customize the List View to display the following columns.

  • 例如,自定义列表视图以显示以下列。

    1. FullName  全名
    2. Position  位置
    3. Department  部门
    4. Email  电子邮件
  • Run the WinForms or ASP.NET application. See if the Contact List View looks like the following image.

  • 运行 WinForms 或ASP.NET应用程序。查看联系人列表视图是否类似于下图。

  • Tip 提示
    When the browser window shrinks, some columns become hidden and can be accessed using the "..." button (see IModelColumnWeb.AdaptivePriority).

    当浏览器窗口收缩时,某些列将变为隐藏状态,可以使用"...""按钮进行访问(请参阅 IModelColumnWeb.自适应优先级)。

If you previously customized the visibility of the Contact List View columns at runtime, the new set of visible columns will not be applied. To remove the previous customization in a WinForms application, click the Reset View Settings button. Alternatively, you can invoke the Runtime Model Editor (using the Tools | Edit Model menu item), right-click the Views | Contact_ListView node and select Reset Differences.

如果以前在运行时自定义了联系人列表视图列的可见性,则将不会应用新的可见列集。要删除 WinForms 应用程序中的先前自定义项,请单击"重置视图设置"按钮。或者,您可以调用运行时模型编辑器(使用工具 |编辑模型菜单项),右键单击视图 |Contact_ListView节点并选择"重置差异"。

You can see the changes made in the lesson in the Model Editor invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

您可以在为模型调用的模型编辑器中看到该课程所做的更改。主演示模块项目。主演示应用程序安装在%PUBLIC%\Documents\DevExpress Demos 19.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/

.

Note 注意
Alternatively, you can customize column order and visibility by changing the value of the Index property of specific columns (Columns node's child nodes). Refer to the List View Columns Customization article to learn more.

或者,您可以通过更改特定列(列节点的子节点)的 Index 属性的值来自列顺序和可见性。有关详细信息,请参阅列表视图列自定义一文。

Tip 提示
You can arrange columns into logical groups (bands). For details, refer to the List View Bands Layout topic.

您可以将列排列到逻辑组(波段)。有关详细信息,请参阅列表视图波段布局主题。

Change Field Layout and Visibility in a List View 在列表视图中更改字段布局和可见性的更多相关文章

  1. 如何在ASP.NET Web站点中统一页面布局[Creating a Consistent Layout in ASP.NET Web Pages(Razor) Sites]

    如何在ASP.NET Web站点中统一页面布局[Creating a Consistent Layout in ASP.NET Web Pages(Razor) Sites] 一.布局页面介绍[Abo ...

  2. MVC入门教程-视图中的Layout使用

    本文目标 1.能够重用Razor模板进行页面的组件化搭建 本文目录 1.母板页_Layout.cshtml 2.用户自定义控件 3.默认Layout引用的使用(_ViewStart.cshtml) 1 ...

  3. iOS 8 Auto Layout界面自动布局系列5-自身内容尺寸约束、修改约束、布局动画

    首先感谢众多网友的支持,最近我实在是事情太多,所以没有写太多.不过看到大家的反馈和评价,我还是要坚持挤出时间给大家分享我的经验.如果你对我写的东西有任何建议.意见或者疑问,请到我的CSDN博客留言: ...

  4. 视图中的Layout使用(转)

    1.母板页_Layout.cshtml 类似于传统WebForm中的.master文件,起到页面整体框架重用的目地 1.母板页代码预览 1 <!DOCTYPE html> 2 <ht ...

  5. MySQL中 指定字段排序函数field()的用法

    MySQL中的field()函数,可以用来对SQL中查询结果集进行指定顺序排序. 函数使用格式如下: order by (str,str1,str2,str3,str4……),str与str1,str ...

  6. Provide Several View Variants for End-Users 为最终用户提供多个视图变体

    In this lesson, you will learn how to provide several customized variants of the same View, and allo ...

  7. Change Fragment layout on orientation change

    Warning: this may be a pre-Lollipop answer. A Fragment doesn't get re-inflated on configuration chan ...

  8. change legend layout from 'vertical' to 'horizontal' in Paraview

    ********** # get color legend/bar for 'vLUT' in view 'renderView1'vLUTColorBar = GetScalarBar(vLUT, ...

  9. 如何更好的通过Inflate layout的方式来实现自定义view

    本篇文章讲的是如何用现有控件产生一个组合控件的方法,十分简单实用.现在开始! 一.需求 我们要实现一个有红点和文字的按钮控件,就像下面这样: 二.实现 我的思路是让一个button和一个textvie ...

随机推荐

  1. Openstack简述

    1.Openstack项目发展概况: Nova 计算服务 Swift 对象存储服务 Glance   镜像服务 Neturon 网络服务 Keystone   身份认证服务 Celimeter   计 ...

  2. C语言笔记 07_枚举&指针

    emum(枚举) 枚举是 C 语言中的一种基本数据类型,它可以让数据更简洁,更易读. 枚举语法定义格式为: enum 枚举名 {枚举元素1,枚举元素2,--}; 举个例子,比如:一星期有 7 天,如果 ...

  3. JavaWeb学习——页面跳转方式

    JavaWeb学习——页面跳转方式 摘要:本文主要学习了请求转发和响应重定向,以及两者之间的区别. 请求转发 相关方法 使用HttpServletRequest对象的 getRequestDispat ...

  4. 【Dos】复制指定文件夹下所有文件到另外指定文件夹下

    bat代码如下: @echo off @set /p fromFile=from: @set /p toFile=to: rem 找到所有文件 dir /b /s %fromFile%\ *.gz & ...

  5. QT获取linux下的当前用户名

    故事背景:客户端启动的时候需要加载机器/home/xx/test.jpg的图片作为背景图,但是有的机器用户名叫AAA,有的机器名叫BBB,所以我需要获取当前用户的home目录 技术调研:QStanda ...

  6. API访问控制设计

    References ● OAuth 2.0 for native apps: https://datatracker.ietf.org/doc/rfc8252/ ● OAuth 2.0 for br ...

  7. IT兄弟连 HTML5教程 DIV+CSS网站首页布局示例

    首页的设计直接影响网站的整体形象,虽然没有一个统一的规范,但最好将其设计为大众化的,只要信息内容能够合理地编排即可,使用户可以方便地找到需要的信息.另外,首页的高度最好不要超过三个屏幕,页面中使用的颜 ...

  8. IDEA的Maven设置阿里镜像

    作为一名.net开发学习java,虽然学习起来没啥难度,但是各种配置实在让人头大. 下面就简单记录下IDEA的Maven设置阿里镜像 进入开发软件的这个设置 点击进入 如图所示 第一个是你安装mave ...

  9. Image 鼠标拖拽与鼠标中键的缩放

    一.Image在窗体上拖拽,势必会用到鼠标的三个事件(MouseDown,MouseUp,MouseMove),以左键为例,PictureBox为载体 Point mouseDownPoint = n ...

  10. 微信小程序的入门

    1.申请账号     官网:https://mp.weixin.qq.com/  2.开发工具      为了帮助开发者简单和高效地开发和调试微信小程序,推出了小程序开发者工具,集成了公众号网页调试和 ...