Hi
Please consider the following:
<igDP:Field Name="Name" Label="{Binding Path=ModeAlt, Mode=OneWay, PresentationTraceSources.TraceLevel=High}">
<igDP:Field.Settings>
<igDP:FieldSettings AllowEdit="False" AllowGroupBy="False" AllowResize="True" CellClickAction="SelectRecord" />
</igDP:Field.Settings>
</igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
When the above code is used, I get a binding error in me immediates window saying:
Cannot find governing FrameworkElement or FrameworkContentElement for target element
Has anyone successfully bound a DtaPresenter Field.Label to a dependency property?
Thanks
PS.. this forum is still nasty as anything for pasting code... so much for pleasent user experiences! :o)
Fields are not part of the visual tree of the XamDataGrid so you cannot bind their properties. However, you can see how to go around this here:
http://blogs.infragistics.com/blogs/josh_smith/archive/2008/06/06/binding-a-xamdatagrid-field-property.aspx
That's fine for when you are creating a viewmodel within the user interface constructor, but if the datacontext is null at that point, how do you change a grids column label text dynamically/programmatically? (it does not necessarily have to be via binding)
<igDP:Field Name="CodeName" Label="Code" Width="Auto" />
I want the text in the label to be dynamic depending on a value in the viewmodel ("xxx Code")
Thanks for the link - my binding attempts in hindsight were possibly an over engineered solution for what I was attempting to achieve, but useful info none-the-less.
Paul