我正在尝试绑定一个IsEnabled属性来检查是否可以编辑GridColumn。 现在Binding I确实喜欢这个
<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}">
现在我收到了这个Binding错误
System.Windows.Data Error: 40 : BindingExpression path error: 'TblLstStatus' property not found on 'object' ''ViewModelSalesOrder' (HashCode=1285414)'. BindingExpression:Path=TblLstStatus.StatusValue; DataItem='ViewModelSalesOrder' (HashCode=1285414); target element is 'GridViewDataColumn' (HashCode=55181770); target property is 'IsEnabled' (type 'Boolean')
由于某种原因,编译器正在为对象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">
父网格
<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">
数据操作(DevForce)
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);
我尝试过的事情