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. Android 7.0 UICC 分析(二)

    本文讲解UiccCard类 /frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/UiccCard.java U ...

  2. 同时打开两个excel工作窗口

    先打开你想要同时打开的两个excel文件,有两个方法可以同时打开两个窗口:首先选取任意一个文件,1. 点击“窗口”菜单==>"重排窗口"==>选择你想同时打开的样式== ...

  3. MINA系列学习-IoBuffer

    在阅读IoBuffer源码之前,我们先看Mina对IoBuffer的描述:A byte buffer used by MINA applications. This is a replacement ...

  4. Swiper.js 中文API手册

    本文分享自 http://www.cnblogs.com/scavengers/p/3760449.html ---------------------------华丽的分割线------------ ...

  5. Bootstrap Table Examples

    The examples of bootstrap table http://bootstrap-table.wenzhixin.net.cn/examples/ http://www.jq22.co ...

  6. 总结--解决 mysql 中文乱码

    首先分析一下导致mysql 中文乱码的原因: 1.建表时使用了latin 编码 2.连接数据库的编码没有指定 3.写入时就已经乱码(这种情况需要自己检查源数据了) 解决方法总结: 1.创建库时指定编码 ...

  7. Robotium-无源码测试

    [总结] 1.新建工程,选择Android Application Project,选择This Project: PS:新建测试工程时报NULL错误,新建一个Android工程,然后再按上诉步骤建立 ...

  8. C# 闭包

    1. 首先要说明的是, delegate 被编译器 编译成一个class, 所以才能传来传去(具体参考 <CLR via C#>第四版), 所以 Action.Func也是如此 2. 在C ...

  9. JsonWriter使用

    Example: 拼一个如下的json格式String {    [        {            "id": 912345678901,            &quo ...

  10. mysql 锁优化

    一.myisam存储引擎锁优化 1.合理理由读写优先级MyISAM 的表锁,写互相阻塞的表锁,默认系统是写优先,可改为读有先:low_priority_updates=1如果我们的系统是一个以读为主, ...