Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用参数绑定WPF datagrid中的combobox_Wpf_Binding_Parameters_Combobox_Itemssource - Fatal编程技术网

使用参数绑定WPF datagrid中的combobox

使用参数绑定WPF datagrid中的combobox,wpf,binding,parameters,combobox,itemssource,Wpf,Binding,Parameters,Combobox,Itemssource,我有一个DataGrid,在模板列中有一个组合框。在该屏幕的其他地方,用户从单独的控件中进行“客户”选择。为了填充datagrid中的组合框,除了网格中每一行的其他信息外,我还需要将所选客户作为参数传入 基本上。。。网格包含零件信息,组合框项目基于以下组合:选定的客户、零件号和制造商。每行的组合框可能具有不同的源列表。有没有办法在XAML中绑定该组合框的ItemsSource?我可能理解不正确,但您可能有一个包含所有这些信息的对象,并将其绑定到组合框 即 回复评论。 让查询返回的行也位于上述C

我有一个DataGrid,在模板列中有一个组合框。在该屏幕的其他地方,用户从单独的控件中进行“客户”选择。为了填充datagrid中的组合框,除了网格中每一行的其他信息外,我还需要将所选客户作为参数传入


基本上。。。网格包含零件信息,组合框项目基于以下组合:选定的客户、零件号和制造商。每行的组合框可能具有不同的源列表。有没有办法在XAML中绑定该组合框的ItemsSource?

我可能理解不正确,但您可能有一个包含所有这些信息的对象,并将其绑定到组合框


回复评论。


让查询返回的行也位于上述ContextualInfo中如何?然后可以将itemsource绑定到该文件。您可以在ContextualInfo类的构造函数中运行查询。

我想我可能解释得不好。我需要运行一个sql查询,它需要三个参数。。。客户ID,零件#,制造商ID。此查询的结果将是每个组合框的项目源。CustomerID在所有项目中都是相同的,但是datagrid中的每个零件的零件和制造商都是不同的。我不同意您将数据行添加到对象,然后将itemssource绑定到该对象。你能展示一些快速的XAML来说明吗?我的问题是,我需要一些参数来自datagrid中的对象,其他参数来自窗口中的其他位置。
public class ContextualInfo
{
    public Customer Customer { get; set; }
    public int PartNumber { get; set; }
    public Manufacturer Manufacturer { get; set; }
}