c# - 在组合框中显示表格的信息
问题描述
我正在尝试将 sql 中的表中的状态信息显示到组合框 1 中,并根据我们在组合框 1 中选择的内容,我想显示该州的城市。wpf 和实体框架需要一些帮助表状态:id int, name nvarchar(50)
表城市:id int,name nvarchar(50),stateId int
解决方案
你必须创建List<State> StateList
包含所有状态对象,给
XAML
<ComboBox ItemsSource = {Binding StateList} SelectedItem = {Binding State}
DisplayMamberPath = "Name"/>`
C#
List<State> StateList // All State
推荐阅读
- javascript - 通过javascript在点击时触发CSS动画
- ssl - Curl 未发送客户端证书
- python - 从模板中的 django-form 获取 html 文本输入元素
- python - 将 BQ 查询结果下载到 Python 数据框时出现 504 Deadline Exceeded 错误
- node.js - 错误:在 BoundPool.end 上多次调用池结束
- windows - 无法为非管理员用户的 PATH 找到 Windows 终端的 wt.exe
- mysql - 为什么我的 SQL 查询不适用于 JDBC Java
- sql - HIVE_PARTITION_SCHEMA_MISMATCH - 不同列之间
- python - Python Dataframe fillna,左列有值
- python - 子类化、继承和子类选择