LookUpEdit

序言

 

LookUpEdit

 滚动条

GridLookUpEdit

删除

复制代码
 private void InitLookUp()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("ProductID", typeof(string));
            dt.Columns.Add("ProductName", typeof(string));
            for (int i = 0; i < 20; i++)
            {
                DataRow dr = dt.NewRow();
                dr["ProductID"] = i.ToString();
                dr["ProductName"] = $"{i}-描述";
                dt.Rows.Add(dr);
            }


            // Bind the edit value to the ProductID field of the "Order Details" table;

            // the edit value matches the value of the ValueMember field.

            //lookUpEditGroupType.DataBindings.Add("EditValue", dt, "ProductID");

            lookUpEditGroupType.Properties.NullText = string.Empty;

            // Prevent columns from being automatically created when a data source is assigned.

            lookUpEditGroupType.Properties.View.OptionsBehavior.AutoPopulateColumns = false;

            // The data source for the dropdown rows

            lookUpEditGroupType.Properties.DataSource = dt;

            // 下拉框显示的字段数据.

            lookUpEditGroupType.Properties.DisplayMember = "ProductName";

            // The field matching the edit value.

            lookUpEditGroupType.Properties.ValueMember = "ProductID";

            // Add two columns in the dropdown:

            // A column to display the values of the ProductID field;

            GridColumn col1 = lookUpEditGroupType.Properties.View.Columns.AddField("ProductID");
            col1.VisibleIndex = 0;
            col1.Caption = "代码";

            // A column to display the values of the ProductName field.

            GridColumn col2 = lookUpEditGroupType.Properties.View.Columns.AddField("ProductName");
            col2.VisibleIndex = 1;
            col2.Caption = "描述";

            // Set column widths according to their contents.

            lookUpEditGroupType.Properties.View.BestFitColumns();

            // Specify the total dropdown width.

            lookUpEditGroupType.Properties.PopupFormWidth = 300;

        }
View Code
复制代码

SearchLookUpEdit

 

资料

GridLookUpEdit多列模糊查询最简单方式

GridControl 继承写法修改自己的GridControl

posted @   ~沐风  阅读(164)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2018-03-07 Redis实战(8)管道
2018-03-07 spring boot(二):注解大全
2017-03-07 Java MyBatis3(2) Mapper代理的开发方式
2016-03-07 [转载]玩转Asp.net MVC 的八个扩展点
2016-03-07 SQLServer处理亿万级别的数据的优化措施

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示