找回密码
 立即注册

QQ登录

只需一步,快速开始

辉仔12586

注册会员

5

主题

15

帖子

60

积分

注册会员

积分
60
最新发帖
辉仔12586
注册会员   /  发表于:2018-7-20 10:14  /   查看:3874  /  回复:7
自己重写了两个GcComboBox,一个
       public ExGcCboSel()
        {
            InitializeComponent();
            this.SideButtons.Clear();
            this.ContentAlignment = ContentAlignment.MiddleLeft;
            this.Ellipsis = GrapeCity.Win.Editors.EllipsisMode.EllipsisEnd;
            this.HighlightText = true;
            this.ImeMode = ImeMode.Off;
            this.ShowOverflowTip = true;
            this.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            this.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Font = new System.Drawing.Font("Meiryo UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        }
另一个
        public ExGcCboSelAutoComp()
        {
            InitializeComponent();
            this.SideButtons.Clear();
            this.ContentAlignment = ContentAlignment.MiddleLeft;
            this.Ellipsis = GrapeCity.Win.Editors.EllipsisMode.EllipsisEnd;
            this.HighlightText = true;
            this.ImeMode = ImeMode.Off;
            this.ShowOverflowTip = true;
            this.AutoComplete.MatchingMode = GrapeCity.Win.Editors.AutoCompleteMatchingMode.ExactMatchAll;
            this.AutoCompleteMode = AutoCompleteMode.Suggest;

            this.AutoCompleteSource = AutoCompleteSource.ListItems;
            this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.Font = new System.Drawing.Font("Meiryo UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
        }
但是第一个可以实现上下方向键选择模糊匹配的项目。但是第二个上下方向键就只能选择原本所有的项目。可能描述的不清楚,下面我会贴图说明。
第一种下键点击可以选中模糊匹配到的。 1.png

第二种模糊匹配结果。 2.png
方向下键点击出现的是最开始的数据源项目 3.png


7 个回复

倒序浏览
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-7-24 17:06:46
推荐
现在是这么设计的,输入时候自动筛选,按了键盘就算选中,筛选过程结束。
没什么办法。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-7-23 17:32:45
推荐
您好,这个是因为AutoCompleteMode不同造成的, SuggestAppend 会自动匹配选中项,而Suggest只是将最接近的选中项滚动到当前。按箭头后实现选中,数据源就还原了。
回复 使用道具 举报
辉仔12586
注册会员   /  发表于:2018-7-23 18:13:15
板凳
非常感谢。那么如果我想实现在AutoCompleteMode为Suggest模式,并且效果和SuggestAppend一样,有没有好的办法?
回复 使用道具 举报
辉仔12586
注册会员   /  发表于:2018-7-25 09:08:44
5#
好吧,我这边最后是通过事件去做的,效果还行。谢谢你的回答。
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-7-25 11:23:04
6#
回复 使用道具 举报
辉仔12586
注册会员   /  发表于:2018-8-3 09:42:38
7#

大神,我问一下,如何判断Spread中,单元格的CellType是ComboBoxCellType?
回复 使用道具 举报
dexteryao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2018-8-3 17:18:22
8#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部