我需要一个带导航控件的Combobox [英] I need a Combobox with navigation controls

查看:70
本文介绍了我需要一个带导航控件的Combobox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个新的组合框控件想要列出不同的疾病症状



它必须

$ / b $ b)从最少1000个条目的数据集合中选择一个项目。

2)无法在初始阶段加载整个数据,因此要提供分页选择一组数据。

I want to create a new combobox Control which want to list different disease symptoms

It have to

1) select a single item from a collection of data of minimum 1000 entries.
2) Cant load the entire data at the initial stage so want to provide pagination to select a set of data.

推荐答案

正如评论中提到的,组合框不是一种方法。对于尝试向下翻阅1000多个条目的用户来说,工作量太大了。我不知道您的选择是进入网格单元格,还是使用全屏,但无论如何,我建议您允许用户使用网格进行选择。当他们单击以选择新值时,调出一个带有网格的简单表单。这将使他们看到的不仅仅是他们选择的价值(这将有助于他们做出更好的选择),并允许他们对与疾病相关的不同属性进行排序和搜索。



一旦他们做出选择,只需将其弹出到主屏幕上的网格或控件中。



如果有某种原因让你觉得你*必须*使用组合框,然后您需要一些方法来获取咬合大小的数据块。例如,如果您确定50个项目是组合中所需的最大项目,请使用top / first 50来获取您的第一个数据块。跟踪最后一条记录的索引值。



例如,假设您正在使用数字ID对它们编制索引。你获得前50名记录,最后一项记录是#50。现在,为了得到下一个数据块的数据你查询数据库中的前50个ID> = 50排序ID(你想在后续页面中包含先前的值,请参阅下面的原因)等等。



现在您需要一些东西来触发分页。也许当用户选择当前50页面中的最后一个值时,您可以查询下一个50并重新绑定到组合框(选择相同的#50),这样他们就可以滚动到底部,选择,然后再次选择下一个50.



真的很笨重,我不推荐它,但它确实存在。
As has been mentioned in the comments, a combo box is not the way to go. There is just too much work for the user trying to page down through 1000+ entries. I don't know if your selection is going into a grid cell, or you are using a full screen, but either way I'd recommend that you allow your user to do selection using a grid. When they click to select a new value, bring up a simple form with a grid on it. That will allow them to see more than just the value they are selecting (which will help them make a better choice) and will allow them to sort and search on different properties associated with the disease.

Once they make their selection, just pop it into the grid or control on your primary screen.

If there is some reason that you feel you *must* use a combo box, then you need some way of getting your data in bite sized chunks. For example, if you decide that 50 items is the maximum that you want in your combo, use a "top/first 50" to get your first chunk of data. Keep track of what the index value is for the last record.

For example, let's say you are getting them indexed on a numeric ID. You get the top 50 records and the last record is #50. Now, in order to get the next "chunk" of data" you query the DB for "top 50 where ID >= 50 sort on ID" (you want to include the previous value in the subsequent pages, see below for reason). And so on.

Now you need something to trigger the pagination. Maybe when the user selects the last value in your current 50 "page", you could query for the next 50 and rebind to the combo box (with the same #50 selected), so that they could scroll to the bottom, select, then select again for the next 50.

Really clunky and I wouldn't recommend it, but there it is.


而不是组合框,请考虑替代 WPF中的AutoSuggest和AutoComplete控件

[ ^ ]
instead of combo box, do consider alternative AutoSuggest and AutoComplete control in WPF
[^]


这篇关于我需要一个带导航控件的Combobox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆