【问题标题】:show the information of a table in combobox在组合框中显示表格的信息
【发布时间】:2018-06-06 11:09:34
【问题描述】:

我正在尝试将 sql 中的表中的状态信息显示到组合框 1 中,并且根据我们在组合框 1 中选择的内容,我想显示该州中的城市。 wpf和实体框架 需要一些帮助 表状态: id int, 名称 nvarchar(50)

表城市: id int, 名称 nvarchar(50), stateId int

【问题讨论】:

  • 你的代码在哪里?

标签: c# wpf entity-framework stored-procedures


【解决方案1】:

您必须创建包含所有状态对象的List<State> StateList, 给

XAML

<ComboBox ItemsSource = {Binding StateList} SelectedItem = {Binding State} 
DisplayMamberPath = "Name"/>`

C#

List<State> StateList // All State

【讨论】:

    猜你喜欢
    • 2019-07-09
    • 1970-01-01
    • 2012-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多