在外键下拉电灯开关中对数据进行排序 [英] Sorting data in Foreign key drop down lightswitch

查看:117
本文介绍了在外键下拉电灯开关中对数据进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其中一个表中将国家/地区作为外键.

I having country as Foreign key in one of the table.

因此它显示为下拉菜单(是下拉菜单吗?请参见上图)

So it is shown as drop down(is it a drop down? see image above)

我的问题是如何在下拉列表/输入中按排序顺序指定数据?

My question is how can I specify the data in the drop down/input is to be in sorted order?

推荐答案

正如Crezzer所述,外键下拉详细信息选择器本质上按输入顺序排序(最早的记录显示在顶部).

As Crezzer mentioned, the foreign key drop down details pickers are intrinsically sorted by entry order (with the earliest records appearing at the top).

但是,如果您想更改此排序顺序,则只需要针对您的国家/地区表添加一个已排序的查询.可以通过单击表设计器屏幕顶部的查询"按钮或右键单击解决方案资源管理器"中的国家/地区"表并选择添加查询"选项来完成此操作.

However, if you'd like to change this sort order, you simply need to add a sorted query against your countries table. This can be done by either clicking the 'Query' button at the top of the table designer screen or by right mouse clicking on the Countries table in the 'Solution Explorer' and choosing the 'Add Query' option.

然后您可以按照以下几行添加查询(指定所需的字段排序):

You can then add a query along the following lines (specifying the desired sort by fields):

然后,在包含国家/地区下拉列表详细信息选择器的屏幕上,您将选择添加数据项..."按钮(在屏幕设计器的顶部),然后将排序后的查询引入屏幕,如下所示:

Then, on the screen featuring the countries drop down details picker, you would select the 'Add Data Item...' button (at the top of the screen designer) and introduce the sorted query onto the screen as follows:

然后,您可以通过在屏幕设计器中突出显示控件,并将选择"属性从自动"更改为添加的查询,来选择使用此排序查询作为下拉详细信息选择器,如下所示(所需的属性选择被突出显示)紫色):

You can then select to use this sorted query for the drop down details picker by highlighting the control in the screen designer and changing the 'Choices' property from 'Auto' to the added query as follows (the required property selection is highlighted in purple):

这篇关于在外键下拉电灯开关中对数据进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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