2014年好久没有更新Blog了,工作调换了,很少用XAF,但还是很关注XAF的发展和学习,对中国的中小企业数据管理软件开发真的太实用了!!

功能比较简单,但很实用,直接上图和代码!

ListView處於ListViewAndDetailView編輯模式

using System;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp;
using DevExpress.Data.Filtering;
using System.Collections.Generic;
using DevExpress.Persistent.Base;
using DevExpress.ExpressApp.Utils;
using DevExpress.ExpressApp.Layout;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Templates;
using DevExpress.Persistent.Validation;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Model.NodeGenerators;
using DevExpress.Xpo;
using DevExpress.XtraEditors;
using DevExpress.ExpressApp.Win.Templates; namespace SimpleProjectManager.Module.Controllers
{
// For more typical usage scenarios, be sure to check out http://documentation.devexpress.com/#Xaf/clsDevExpressExpressAppViewControllertopic.
public partial class EditerPlusieursLignesListViewController : ViewController<ListView>
{
public EditerPlusieursLignesListViewController()
{
InitializeComponent();
RegisterActions(components);
// Target required Views (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
if (View == null)
return; if(((ListView)View).EditView == null)
return; if( ((ListView)View).EditView.Items==null)
return; foreach (ViewItem item in ((ListView)View).EditView.Items)
{
item.ControlCreated += item_ControlCreated;
}
} void item_ControlCreated(object sender, EventArgs e)
{
ViewItem item = (ViewItem)sender;
if (item.Control.GetType() == typeof(NestedFrameTemplate)) return;
((BaseEdit)item.Control).EditValueChanged += (sender2, e2) =>
{
if (View != null && View.SelectedObjects.Count > )
{
foreach (XPBaseObject xpo in View.SelectedObjects)
{
xpo.SetMemberValue(item.Id, ((BaseEdit)sender2).EditValue);
}
}
};
}
}
}

[原] XAF How to Edit multiple objects in a ListViewAndDetailView的更多相关文章

  1. [原] XAF How to bind a stored procedure to a ListView in XAF

    First, I suggest that you review the following topic to learn how to show a custom set of objects in ...

  2. [原] XAF 如何将数据库中Byte array图片显示出来

    问题比较简单,直接上代码. private Image _Cover; [Size(SizeAttribute.Unlimited), ValueConverter(typeof(ImageValue ...

  3. [原] XAF 如何基于业务规则禁用属性

    How to: Disable Property Editors Based on a Business Rule // Developer Express Code Central Example: ...

  4. [原] XAF 添加日期筛选下拉选择

    1.ListView 添加日期筛选下拉选择,选择指定,可指定日期范围 2.Code using DevExpress.Data.Filtering; using DevExpress.ExpressA ...

  5. [原] XAF ListView 凍結列

    using System; using System.ComponentModel; using System.Collections.Generic; using System.Diagnostic ...

  6. [原] XAF 如何启用ListView Top N records 提升用户使用体验

    為了提升用戶使用體驗,特擴展此功能(來源與Xafari Framework).1.可在模型編輯器中設置是否啓用,默認啓用.2.DataAccessMode為Client模式才啓用.其它模式自動關閉.3 ...

  7. [原] XAF 如何啟用ListView橫向滾動條

    using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...

  8. [原] XAF How can I change XafDisplayNameAttribute dynamically

    void ViewControlsCreated(object sender, EventArgs e) { foreach (StringPropertyEditor item in view.Ge ...

  9. [原] XAF 如何非常容易禁止清除一个下拉字段的值?

随机推荐

  1. 解决: maven编译项目报“非法字符: \65279 ”错误

    打包maven项目的时候,出现异常: [INFO] ------------------------------------------------------------------------ [ ...

  2. 3.3.2 pulseIn(pin,state,timeout)

    pulseIn函数用于读取引脚脉冲的时间长度,脉冲可以是HIGH或LOW.如果是HIGH,函数将先等引脚变为高电平,然后开始计时,一直到变为低电平为止.返回脉冲持续的时间长短, 单位为ms.如果超时还 ...

  3. 关于display:flex

    遇到了一个bug 就是display:flex   遇到的bug原型就是,项目容器的diaplay:flex ,一行项目五个,到最后一行只剩两个的时候 是两端对齐的,如果再添加的话 也就是两端各一个子 ...

  4. Hibernate一对一双向关联(注解)

    每一个人(Person)对应一个身份证号(IdCard) package cqvie.yjq.domain; import java.util.Date; import javax.persisten ...

  5. 09-JAVA中的异常处理

    1. 程序执行结果: 也就是它根本就没抛出异常,更别提捕获异常了.那么,为什么会这样呢? 原来, 如上面程序展示,程序运行到k=i/j;的时候,就会直接终止,根本就不会运行到监视的程序,更不会运行到捕 ...

  6. JVM常量池

    常量池(constant_pool)指的是在编译期被确定,并被保存在已编译的.class文件中的一些数据.它包括了关于类.方法.接口等中的常量,也包括字符串常量和符号引用.运行时常量池是方法区的一部分 ...

  7. PHP向mysql中插入数据的方法

    require "database.php"; $po_code = "YMWF2015-6-25-1"; $customer = "youmei&q ...

  8. NC 单据保存时间过长,判断数据库锁表解决办法

    SELECT s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.o ...

  9. 利用windows服务+timer或者windows任务计划程序+控制台进行进行每日邮件推送

    1.邮件发送代码 using System.Text; using System.Net; using System.Net.Mail; using System.Reflection; using ...

  10. ListView显示不同行以及数据重用

    Handling ListViews with Multiple Row Types When you start writing Android Apps it isn’t long before ...