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
180
How do I obtain a field from the selected record?
posted

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:Field.Settings>

<igDP:FieldSettings CellValuePresenterStyle="{StaticResource GolferName}" />

</igDP:Field.Settings>

</igDP:Field>

<igDP:Field Name="Handicap" IsExpandable="False">

<igDP:Field.Settings>

<igDP:FieldSettings CellValuePresenterStyle="{StaticResource GolferHandicap}" />

</igDP:Field.Settings>

</igDP:Field>

</igDP:FieldLayout.Fields>

</igDP:FieldLayout>

</igDP:XamDataCarousel.FieldLayouts>

Parents
No Data
Reply
  • 69686
    posted

    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.

Children
No Data