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的更多相关文章
-
[原] 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 ...
-
[原] XAF 如何将数据库中Byte array图片显示出来
问题比较简单,直接上代码. private Image _Cover; [Size(SizeAttribute.Unlimited), ValueConverter(typeof(ImageValue ...
-
[原] XAF 如何基于业务规则禁用属性
How to: Disable Property Editors Based on a Business Rule // Developer Express Code Central Example: ...
-
[原] XAF 添加日期筛选下拉选择
1.ListView 添加日期筛选下拉选择,选择指定,可指定日期范围 2.Code using DevExpress.Data.Filtering; using DevExpress.ExpressA ...
-
[原] XAF ListView 凍結列
using System; using System.ComponentModel; using System.Collections.Generic; using System.Diagnostic ...
-
[原] XAF 如何启用ListView Top N records 提升用户使用体验
為了提升用戶使用體驗,特擴展此功能(來源與Xafari Framework).1.可在模型編輯器中設置是否啓用,默認啓用.2.DataAccessMode為Client模式才啓用.其它模式自動關閉.3 ...
-
[原] XAF 如何啟用ListView橫向滾動條
using System; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress ...
-
[原] XAF How can I change XafDisplayNameAttribute dynamically
void ViewControlsCreated(object sender, EventArgs e) { foreach (StringPropertyEditor item in view.Ge ...
- [原] XAF 如何非常容易禁止清除一个下拉字段的值?
随机推荐
-
我厂 WiFi SDK 开源了, 直接开源 WiFi 万能钥匙核心功能,造福中小开发者
官方地址: http://global.18wifibank.com/ github: https://github.com/yibawifi/wifisdk
-
SQL_CURSOR_游标循环
) DECLARE My_Cursor CURSOR --定义游标 FOR (SELECT column1 FROM #temp1) --查出需要的集合放到游标中 OPEN My_Cursor; -- ...
-
基于Equinox构建OSGi项目
几种OSGi框架 Several independently implemented OSGi frameworks exist today, including four that are avai ...
-
MFC基本框架
MFC基本框架 By 小戴 发表于 2006-12-21 15:59:00 MFC 应用程序框架 1. MFC 简介: MFC ( Microsoft Foundation Class )是由 ...
-
python--第十七天总结(Django)
基本配置 一.创建django程序 终端命令:django-admin startproject sitename IDE创建Django程序时,本质上都是自动执行上述命令 其他常用命令: pytho ...
-
SDE ST_Geometry SQL st_intersects查询很慢的解决方法
环境:服务端 SDE 10.0 oracle 11.2,客户端 PLSQL 11,oracle 11.2 为了调试方便,以下测试都是把sql提取出来在PLSQL上做 需求是已知一个多边形的点坐标,要在 ...
-
Mac下常用工具
MySql--Sequel Pro
-
mybatis初识
mybatis采用弱连接,在一定程度上集中管理了sql的语句编写,又实现了自动映射bean. 此处以最基础的mybatis连接为例: 引入jar包: mybatis-3.4.5.jar ojdbc-6 ...
-
【推导】The 16th UESTC Programming Contest Preliminary L - Foxtrot
题意:有n瓶药剂,其中只有一瓶药剂有毒.让你用最少的小白鼠试出哪瓶有毒.你只有一次给任意只小白鼠各喂食任意种类药剂的机会. m只老鼠就能对应2^m种“生死状态”的组合,给每种状态分配一个种类的药剂,然 ...
-
Android 读写位于SD卡上的sqlite数据库文件错误问题
09-12 15:24:33.903: W/System.err(19499): java.lang.NullPointerException: Attempt to invoke virtual m ...