I am having trouble getting this to work:
<igWpf:Field Row="2" Column="25" Name="{Binding Path=TrustGL.GLAccountNumber, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Label="Cost Center"/>
i also tried:
<igWpf:Field Row="2" Column="25" Name="{Binding Path=DataContext.TrustGL.GLAccountNumber, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Label="Cost Center"/>
<igWpf:Field Row="2" Column="25" Name="{igWpf:FieldBinding TrustGL.GLAccountNumber}" Label="Cost Center"/>
None of these seem to work.
Can you tell me what is required?
TrustGL is an object in an object in a collection that the DataSource is using.
Hi Edward,
If TrustGL is an object inside of another object inside of a collection then none of these bindings will work. The first thing I want to mention is that the Field class is not a FrameworkElement or DependencyObject so it is not part of the Visual Tree and it does not inherit a DataContext like a typical control would. The DataContext property on the Field class is something Infragistics added and we set it up so that it would work in a similar manner. The issue is, a typical binding such as "{Binding Path=TrustGL.GLAccountNumber}" won't work. You need to specify a source for the binding. The typical way to do this is by using "RelativeSource={RelativeSource Self}". So:
"{Binding RelativeSource={RelativeSource Self}, Path=DataContext.MyViewModelProperty}"
Since your TrustGL object is inside another object which is inside a collection then your binding path needs to include this collection, accessing a specific item in this collection and then accessing TrustGL. I don't know what the exact path should look like since I don't know what your structure actually looks like but it sounds like it should be something like this:
Path=DataContext.MyCollection[0].MyObject.TrustGL
I want to clarify that the Name property on the Field class is meant to be assigned to the name of a property in your underlying data. It's a little odd that you are trying to bind the Field's Name property to a property in your DataSource collection. Can you provide some context/detail as to what exactly you are trying to accomplish with this type of binding? I can try and show you how to properly set this up.
I got it working. thanks for the help