Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.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
C# 在错误的位置进行绑定搜索_C#_Wpf_Binding_Converter - Fatal编程技术网

C# 在错误的位置进行绑定搜索

C# 在错误的位置进行绑定搜索,c#,wpf,binding,converter,C#,Wpf,Binding,Converter,我正在尝试在IsEnabled属性上绑定,以检查GridColumn是否可以编辑。 现在我做的装订是这样的 <telerik:GridViewDataColumn Header="Quantity Shipped" UniqueName="QuantityShipped" DataMemberBinding="{Binding QuantityShipped}" IsEnabled="{Binding TblLstStatus.StatusValue, Converter={StaticR

我正在尝试在IsEnabled属性上绑定,以检查GridColumn是否可以编辑。 现在我做的装订是这样的

<telerik:GridViewDataColumn Header="Quantity Shipped" UniqueName="QuantityShipped" DataMemberBinding="{Binding QuantityShipped}" IsEnabled="{Binding TblLstStatus.StatusValue, Converter={StaticResource StatusValToBool},ConverterParameter='20;200'}" Width="Auto" CellStyle="{StaticResource CellStyleNormal}">
出于某种原因,编译器正在为对象TblLstStatus搜索错误的位置,我不知道为什么

网格声明

<telerik:RadGridView x:Name="dataGridDetail" d:LayoutOverrides="Height" ItemsSource={Binding SelectedItem.TblDatODSales, ElementName=dataGrid}" Background="{x:Null}" Grid.Row="2" Grid.ColumnSpan="2" 
RowHeight="20" CanUserDeleteRows="False" CanUserInsertRows="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="false" SelectionMode="Single" SelectionChanged="dataGrid_SelectionChanged"
EditTriggers="Default,CellClick">

由于某种原因,编译器正在错误的位置搜索对象TblLstStatus。。。不准确的你找错地方了。我只能假设您的集合中有
ViewModelSalesOrder
项,那么
DataGridColumn
除了在row对象中之外,还应该在哪里查找其数据?您需要先显示数据层次结构,然后任何人才能确定实际的
绑定路径应该是什么。如果将集合绑定到DataGrid,那么给定的集合不应该是ItemSource的内容吗?
<telerik:RadGridView x:Name="dataGridDetail" d:LayoutOverrides="Height" ItemsSource={Binding SelectedItem.TblDatODSales, ElementName=dataGrid}" Background="{x:Null}" Grid.Row="2" Grid.ColumnSpan="2" 
RowHeight="20" CanUserDeleteRows="False" CanUserInsertRows="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="false" SelectionMode="Single" SelectionChanged="dataGrid_SelectionChanged"
EditTriggers="Default,CellClick">
<telerik:RadGridView x:Name="dataGrid" ItemsSource="{Binding Orders}" d:LayoutOverrides="Height" Background="{x:Null}" Grid.ColumnSpan="2" 
RowHeight="20" CanUserDeleteRows="False" CanUserInsertRows="False" AutoGenerateColumns="False" ShowGroupPanel="True" IsFilteringAllowed="true" SelectionMode="Single" 
MouseDoubleClick="dataGrid_MouseDoubleClick" EditTriggers="Default,CellClick">
query = query.Include("TblLstStatus")
                         .Include("TblLstStaff_Req")
                         .Include("TblLstStaff_Resp")
                         .Include("TblLstOrganisation_Req")
                         .Include("TblDatODSales.TblLstART")
                         .Include("TblDatODSales.TblLstStatus").OrderByDescending(c => c.CreationDate);

            statusQuery = statusQuery.Include("TblLstStatusType");

            _dataService.GetManager().ExecuteQueryAsync(query, argsv =>
            {
                if (argsv.Error == null && argsv.Results != null)
                {
                    this.Orders = new ObservableCollection<TblDatOrderSales>(argsv.Results);
                }
            }, null);