Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Binding to a DataCard field?
posted

Hello,

maybe my question is really simple, but I just do not get it and I googled a lot.

I have a xamDataCard control with only one DataCard. I want to bind another control to one field of that DataCard, which holds a numeric value. (More precise it is a RadialGaugeNeedle and I want to bind the Value of it to that value of the one field of the DataCard. But it does not really matter, could be any other control, I think I just do not know how to write the Path=??? correct.)

Here is my DataCard so far:

 <igDP:XamDataCards Grid.Row="2" HorizontalAlignment="Left" Margin="12,12,0,0" Name="xamDataCards1" VerticalAlignment="Top" DataSource="{Binding ElementName=xamMultiColumnComboEditor1, Path=SelectedItems}" >
            
            <igDP:XamDataCards.FieldLayouts>
                <igDP:FieldLayout  >
            <igDP:FieldLayout.Fields>
                <igDP:Field Name="Name" Label="Name" />
                <igDP:Field Name="Volume" Label="Volume" />
                        <igDP:Field Name="TargetWeight" Label="Target Weight" />
                        <igDP:Field Name="ImageUrl" Label="Image" />
                        <igDP:UnboundField Name ="RealWeight" Label="Real Weight" />
                       
            </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataCards.FieldLayouts>
        </igDP:XamDataCards>

I want to be able to edit the "Real Weight" field and have the number bound to GaugeNeedle or whatever. So:

<ig:RadialGaugeNeedle Value="{Binding ElementName=xamDataCards1, Path=???,  FallbackValue=0}" />

How do I have to set the Path, that is my big question? (Or do I have to write the ElementName also in a different way?) In fake pseudo code I want to write something like Path=Card[0].Field["RealWeight"].Value or more grid-like Path=Row[0].Column["RealWeight"].Value
I think you get my point. :-)
Thank you very much.
I would appreciate it when you could post the solution for the xamDataGrid and the xamDataPresenter, too. I mean, how to bind something to a cell-value of a xamDataGrid