从另一个选择中选择一个下拉菜单 [英] selection of one dropdown from selection from other

查看:89
本文介绍了从另一个选择中选择一个下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想选择一个下拉选项并引起另一个组合框的填充,这是根据第一次选择的标准完成的,但是两者都来自同一张表.

我有两个表.我什至希望第二个表的详细信息都引用要在表单上显示的第一个表.但是我不想一次又一次地查询...


i want to select a dropdown option and cause population of another combobox which is done onthe criteria of first selection.but both are from same table.

I have two tables.i want even second tables details which refer the first table to be displayed on the form..but i dont want to query again and again...


can i do the selection of comboxes in single query without using multiple queries..

推荐答案

我建​​议您考虑使用LINQ.

它使您可以操纵组合框的内容(即内存中的项目).

因此,第一个comboBox中的选择可用于创建LINQ查询以填充第二个combobox,所有这些都使用相同的数据数组作为输入.

从另一个角度来看,加载初始数据并对其进行处理以填充所有组合框,就像将一部分原始数据源带入应用程序一样.


I suggest you look into using LINQ.

It allows you to manipulate the contents of the comboboxes (i.e, items in memory).

So, selection in first comboBox can be used to create LINQ query to populate second combobox, all using the same data array for input.

As an alternative perspective, load your initial data and manipulate it to fill all of your comboboxes, much like bringing a piece of your original data source into your application.



这篇关于从另一个选择中选择一个下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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