We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic Rotator Items containing dynamic Grid data

Thread ID:

Created:

Updated:

Platform:

Replies:

144210 Apr 24,2019 11:58 PM UTC Apr 29,2019 05:45 AM UTC Xamarin.Forms 3
loading
Tags: SfRotator
Mitch Harhay
Asked On April 24, 2019 11:58 PM UTC

Hello,

I'm working on a project where the logged in user may have n # of data tables of similar data being pulled from a web service.  The data returned always contains the same data schema but the identifier would be different.  One user may have 1 set of data and another user may have 5 sets of data.

My goal is to dynamically add Rotator items to match the returned data set for the user.

If the user only has 1 data table of data, only one rotator item listing the data in a grid would be shown.  If the user has 5 sets of data, there would be 5 rotator items each containing a grid displaying the data.

Is this possible to achieve using the SfRotator control with the ItemTemplate containing Grids of data that are all uniquely bound?

Thank you,
Mitch

Muneesh Kumar G [Syncfusion]
Replied On April 25, 2019 12:01 PM UTC

Hi Mitch, 
 
Greetings from Syncfusion. 
 
We have analyzed your requirement and we have prepared a sample based on this. We have implemented the SfRotator’s ItemTemplate with SfDataGrid and displayed the same data that bound with view as per the below code snippet.  
 
 
In this sample, we have done the following things, 
 
1. Added SfDataGrid as an ItemTemplate in Rotator and also set binding for the Rotator and DataGrid ItemsSource. Please refer below code snippet for this 
 
 <ContentPage.BindingContext>
        <local:OrderInfoRepository />
    </ContentPage.BindingContext>
    <ContentPage.Content>
        <StackLayout>
            <Button x:Name="Add"  Clicked="Add_Clicked" Text="Add" HorizontalOptions="Center" VerticalOptions="Center" />
            <rotator:SfRotator x:Name="rotator" ItemsSource="{Binding RotatorCollection,Mode=TwoWay }" NavigationDirection="Horizontal" NavigationStripMode="Thumbnail" NavigationStripPosition="Bottom">
                <rotator:SfRotator.ItemTemplate>
                    <DataTemplate>
                       <dataGrid:SfDataGrid ItemsSource="{Binding OrderInfoCollection,Mode=TwoWay}" />
                    </DataTemplate>
                </rotator:SfRotator.ItemTemplate>
            </rotator:SfRotator>
        </StackLayout>
    </ContentPage.Content> 
 
 
2. Added the button click to change the Rotator Items and data of SfDataGrid dynamically. 
 
Please refer the below screenshot for this 
 
 
 
 
We request you to try our sample, if this is not your requirement please get back to us with further details. 
 
Thanks, 
Muneesh Kumar G. 


Padmini Ramamurthy [Syncfusion]
Replied On April 29, 2019 05:24 AM UTC

From: Mitch Harhay
Sent: Friday, April 26, 2019 6:28 PM
To: Syncfusion Support <support@syncfusion.com>
Subject: Re: Syncfusion support community forum 144210, Dynamic Rotator Items containing dynamic Grid data, has been updated. 

Thank you - this worked perfectly.
 


Muneesh Kumar G [Syncfusion]
Replied On April 29, 2019 05:45 AM UTC

Hi Mitch,  
 
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
   
Thanks,   
Muneesh Kumar G.   
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon