CSharp_DevExpress_编辑智能提示功能实现;

该博客介绍了如何在C#中使用DevExpress的RepositoryItemTextEdit组件,实现在编辑时自动过滤并显示匹配的数据。内容包括设计思路、实现效果展示及具体的代码实现细节,特别是针对FormView的配置。
摘要由CSDN通过智能技术生成

功能: 在RepositoryItemTextEdit内置编辑器编辑时,自动过滤匹配数据;


=>设计图


=>效果图


=>代码_FormView

using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
using HelloWorld.classEntity;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
using System.Collections;
using DevExpress.XtraGrid.Views.Grid;
using System.Drawing;
using DevExpress.XtraGrid.Columns;

namespace HelloWorld
{
    public partial class FormView : Form
    {
        // 数据表格
        private readonly DataTable fvdt;

        // 数据列表
        private readonly List<string> listData;
        // 过滤基数_修改后值
        private string editStr;
        // 容器位置
        private Point location;

        // 视图大小
        private readonly int viewWidth;
        private readonly int viewHeight;


        public FormView()
        {
            InitializeComponent();

            /// 初始数据_表格
            fvdt = getDataTable(16);

            /// 初始数据_列表_指定智能提示列
            listData = getDataList(fvdt, "name");
            // 弹出容器_设置
            int wvalue = getColumnWidth(fvgridview, "姓名");
            fv_pccLbCtrl.Width = wvalue;
            fvpopupcctrl.Width = wvalue + 6;
            fv_pccLbCtrl.Height = 150;
            fvpopupcctrl.Height = 156;

            // 容器位置_(默认)记得手动调节位置(添加增量);
            location = new Point(getColumnX(fvgridview, "姓名") + 20, 56);

            // 视图大小_设置
            viewWidth = fvgridctrl.Width;
            viewHeight = fvgridctrl.Height;
        }

        private void FormView_Load(object sender, EventArgs e)
        {
            // GridCtrl_绑定数据源
            fvgridctrl.DataSource = fvdt;
            fvcolDel.Caption = " "; // 操作行;
            // 视图单击_获取鼠标坐标
            fvgridview.MouseDown += fvgri
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值