zoukankan      html  css  js  c++  java
  • DevExpress_XAF_详细视图的简单布局

    在查看到官方文档之前,一直视图的布局只能在xafm文档中完成。原来可以在代码中直接设置DetailViewLayoutAttribute属性。

    布局前

      布局前效果:

      布局前源代码:

     1 public class Contact {
     2     [Browsable(false)]
     3     public int ID { get; private set; }
     4     public string FirstName { get; set; }
     5     public string LastName { get; set; }
     6     public string FullName {
     7         get { return FirstName + " " + LastName; }
     8     }
     9     public string Email { get; set; }
    10     public virtual Contact Manager { get; set; }
    11     public DateTime? Birthday { get; set; }
    12     [FieldSize(FieldSizeAttribute.Unlimited)]
    13     public string Notes { get; set; }
    14     [FieldSize(FieldSizeAttribute.Unlimited)]
    15     public string Remarks { get; set; }
    16 }

     布局后

      布局后效果:

     

      布局后源代码:

     1 public class Contact {
     2     [Browsable(false)]
     3     public int ID { get; private set; }
     4   [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
     5   //左侧
     6     public string FirstName { get; set; }
     7   [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
     8   //右侧
     9     public string LastName { get; set; }
    10   [DetailViewLayoutAttribute("FullName", 0)]
    11   //占一行
    12     public string FullName {
    13         get { return FirstName + " " + LastName; }
    14     }
    15     [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
    16     public string Email { get; set; }
    17     [DetailViewLayoutAttribute(LayoutColumnPosition.Right)]
    18     public virtual Contact Manager { get; set; }
    19     [DetailViewLayoutAttribute(LayoutColumnPosition.Left)]
    20     public DateTime? Birthday { get; set; }
    21     [FieldSize(FieldSizeAttribute.Unlimited)]
    22     [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
    23     public string Notes { get; set; }
    24     [FieldSize(FieldSizeAttribute.Unlimited)]
    25     [DetailViewLayoutAttribute("NotesAndRemarks", LayoutGroupType.TabbedGroup, 100)]
    26     public string Remarks { get; set; }
    27 }

    参考网址

      [1] https://documentation.devexpress.com/eXpressAppFramework/DevExpress.ExpressApp.Model.DetailViewLayoutAttribute.class

  • 相关阅读:
    easypoi添加下拉预选值
    java启动项目字符编码和配置文件的字符编码问题
    leetcode
    leetcode
    leetcode
    leetcode
    事务的隔离级别- 极客时间()
    数据库的事务
    SQL中的视图(极客时间)
    SQL中的连接(极客时间)
  • 原文地址:https://www.cnblogs.com/luyj00436/p/11458877.html
Copyright © 2011-2022 走看看