Create PaginationControl by Code , Not binding

2 posts, 0 answers
  1. dương
    dương avatar
    1 posts
    Member since:
    May 2014

    Posted 22 May 2014 Link to this post

    Hi 
    I have a SlideView with items. But each item is Grid. Each item not same

    This is code :

    private ObservableCollection<Grid> radItemtemList = new ObservableCollection<Grid>();

                for (int i = CountList - 1; i >= 0; i--)
                {
                    Grid gr = new Grid() { Tag = i };
                    gr.Children.Add(new PiecesTemplate(item, null, iso));
                    radItemtemList.Add(gr);
                }
    slideView.ItemsSource = radItemtemList;
    slideView.SelectionChanged += slideView_SelectionChanged;

    Now i want use PaginationControl And PreviewTemplate for this slideView.  
    How can i do ?


  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 27 May 2014 Link to this post

    Hi,

    Thank you for wiring.

    In order to use RadPaginationControl in code and set its relation to RadSlideView, you simply need to set its PageProvider similarly to the way this is done in our examples:

    paginationControl.PageProvider = slideView;

    The ItemPreviewTemplate replaces the ItemTemplate for the adjacent items, so my suggestion is to move the Grid to an ItemTemplate that is reused instead of adding new Grid instances as actual items. Similar scenario is demonstrated in this article.

    I hope this information helps.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
Back to Top