ControlDemo/frmLookupEditor.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DonkingControlDemo
{
public partial class frmLookupEditor : Form
{
public frmLookupEditor()
{
InitializeComponent();
}
// 下载于www.51aspx.com
List<clshdrinfo> lst = new List<clshdrinfo>();//LookupEditor 的数据源,数据源为List<> 不能用table
private void frmLookupEditor_Load(object sender, EventArgs e)
{
BindlookupEditor();
}
void BindlookupEditor()
{
//lookupEditor1
lst = clsGetData.GetHdrList();//获取数据源
this.lookupEditor1.Mapping.Add("单号-列头", "BillNO");//映射 字段
this.lookupEditor1.Mapping.Add("单名", "BillName");
this.lookupEditor1.Mapping.Add("列1", "hdr_col1");
this.lookupEditor1.Mapping.Add("列2", "hdr_col2");
this.lookupEditor1.DisplayMember = "BillName";//选中后,显示在text文本框中的信息
this.lookupEditor1.IsOpen = true;//是否允许打开
this.lookupEditor1.PropertyChanged += new PropertyChangedEventHandler(lookupEditor1_PropertyChanged);
}
void lookupEditor1_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
string condition = lookupEditor1.Text;
this.lookupEditor1.DataSource = lst.Where(s => s.BillNO.Contains(condition) || s.BillName.Contains(condition));
if (lookupEditor1.Target != null)
{
clshdrinfo info = (clshdrinfo)lookupEditor1.Target;
lblContent.Text = info.BillNO + "|" + info.BillName + "|" + info.hdr_col1;
}
}
private void btnReset_Click(object sender, EventArgs e)
{
//==如果一个窗体有多个lookupEditor,重置方法可以判断控件类型,然后批处理
lookupEditor1.IsOpen = false;//先关闭
lookupEditor1.DisplayValue = string.Empty;
后面还有 29 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。