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. FMDB中 databaseWithPath 的使用问题

    阅读fmdb的源码文件(下载地址http://github.com/ccgus/fmdb)会发现下面一段注释,里面提到的创建数据库的方法也在很多博客中被引用,但是跑代码的时候发现,文件并不会像文档中所 ...

  2. poj1087 A Plug for UNIX(网络流最大流)

    http://poj.org/problem?id=1087 好久没遇见过这么坑的题了这个题真是挫的够可以的.题目大意:你作为某高管去住宿了,然后宾馆里有几种插座,分别有其对应型号,你携带了几种用电器 ...

  3. MySQL命令实例

    显示数据表结构 1.desc(describe) tablename;2.show columns from tablename;3.use information_schema;    select ...

  4. Flask备注4(Structure)

    Flask备注4(Structure) package 通过Flask可以非常简单的通过一个module(一个py文件)创建一个简单的application.这种简单程序的文件结构如下: /youra ...

  5. host 备份

    # Copyright (c) 1993-1999 Microsoft Corp.## This is a sample HOSTS file used by Microsoft TCP/IP for ...

  6. create()创建的控件不能映射消息函数的解决

    有时,使用create()在运行时创建的控件不能将消息映射到父窗口内,此时需要使用消息转发的机制,主要原理:注册一个全局的消息,针对接收消息的控件编写继承类,在该继承类中响应消息,并将已注册的全局消息 ...

  7. xcode8 上传ipa文件无法构建版本

    在xcode8 升级后上传ipa文件 需要设置一个安全提示,现在上传app store的方式为xcode或者 application loader 一.xcode 准备工作完成后点击Product-- ...

  8. 00024500-0000-0000-C000-000000000046错误,在sys.web配置节添加一个用户给web站点。

    <identity impersonate ="true" userName="administrator" password="123456& ...

  9. html之间的传值

    传值:window.location.href=“eidit.html?activityId=“+acytivityIDd: 将id放进地址栏传到另一html页面 接受 再用var  str=wind ...

  10. 猜数字 事先给定一个数字,然后让用户猜3次,猜不中就输了,猜中就赢了。 每次猜错,给出提示,less or big

    c = 0a = 10while c <3:    b = int(raw_input("请输入数字"))    if b == a:        print " ...