Hello,
i have a extended object which contains a DataTable - Property with my datasource.
on the basis of databinding and avoidance of code behind (a impossible thing with XamDataGrid :-( ) i have set my entity business object into the datacontext property of XamDataGrid.
DataContext="{Binding Path=MaskControl.Entities[ADR_Verteiler]}"
in code behind i have a centralized method to bring out all necessary datas from DataContext.
Dim Ent As swb_MaskControl.SWBMaskControlEntity = pGetEntityContext(Grid) If Ent IsNot Nothing Then 'Grid.DataContext = Nothing
Dim bnd As New System.Windows.Data.Binding bnd.Source = Ent bnd.Path = New System.Windows.PropertyPath("DataTable.DefaultView") Grid.SetBinding(DataPresenterBase.DataSourceProperty, bnd) Grid.FieldLayoutSettings.AllowAddNew = True Grid.FieldLayoutSettings.HighlightAlternateRecords = True Dim bndReadonly As New System.Windows.Data.Binding bndReadonly.Source = Ent bndReadonly.Converter = New swb_System.Converter.BoolToOppositeNullableBoolConverter bndReadonly.Path = New System.Windows.PropertyPath("IsReadonly")
.
everything works, but i have a lot of BindingExpressions at runtime. if i set the datacontext to nothing i have no more BindingExpression errors.
i'm waiting eagerly for an update.
Thank you.
If you can provide us with the full messages of the exception, I would probably be able to tell you where the binding went wrong. The exception (the one as a title to this forum thread) means that you are trying to bind IsSpeacialRecord property of some object, which is not a Record. The rest of the exception shows which that object is. Note that in most of the cases you have to set the RelativeSource property of the Binding as well to target the correct element.
System.Windows.Data Error: 39 : BindingExpression path error: 'IsSpecialRecord' property not found on 'object' ''SWBMaskControlEntity' (HashCode=48346534)'. BindingExpression:Path=IsSpecialRecord; DataItem='SWBMaskControlEntity' (HashCode=48346534); target element is 'DataRecordPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
What is the exact build version that you are using? If it is not the latest service release (2049) you should download and test with it.
Hi Alex I am also facing with the same problem. I am currently using infragistics netadvantages for wpf 2009 vol 2. can you please suggest me the solution in this regard thanks.
One of our developers said that if you are not using the latest version you probably need to test this with the latest service release, as it is something that we have already resolved.
Hello Alex.
i have no styles and templates for XamDataGrid.
What I think this binding says, is that you are trying to find the IsSpecialRecord property on the SWBMaskControlEntity object.
If you have created a style for the DataRecordPresenter, you need to set the RelativeSource to Self and change the path to Record.IsSpecialRecord.