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
Thank you for your post. I have been looking into it and I can suggest you set the Path like this:
Path=Records[0].Cells[TargetWeight].Value
The Path for the XamDataGrid and XamDataPresenter is the same. Please let me now if his helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello Stefan,
thank you for your answer. It works and is really stupid simple, so sorry for asking... At least I am happy that it works the way I expected it.
I think the Problem was, that I believe to much in IntelliSense, because when I type Path=Records[0]. it does not offer me Cells (Records was offered). Actually when I just write it, Cells is underlined and the message is "Cannot resolve property 'Cells' in data context of type Infragistics.Windows.DataPresenter.Records"
But anyway, when I ignore it, it runs, so thanks again.