I have a XamDataCarousel that loads data from SQL. I want to set a global variable based on one of the fields in the selected CarouselItem. I have setup FieldLayouts which handle the fields from the record. Anyone know how to do this? Here is the FieldLayouts section in XAML... I want to set the global variable to the "Name" field:
<igDP:XamDataCarousel.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Picture" IsExpandable="False">
<igDP:Field.Settings>
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource ImageCell}"/>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="Name" IsExpandable="False">
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource GolferName}" />
<igDP:Field Name="Handicap" IsExpandable="False">
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource GolferHandicap}" />
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataCarousel.FieldLayouts>
Hello,
The DataRecord exposes its Cells collection. So basically, you need to cast the Selected Record to DataRecord and then get to the Cells Collection.
For example:
private void RecordActivated (...)
{
DataRecord dr = e.Record as DataRecord;
dr.Cells[]
dr.FieldLayout.Fields[]
}
Hope this helps.