Paging source code of the telerik Control

Source: Internet
Author: User

1. Define the data source of the paging control. You can set the data source of radgridview to point to the paging control.
Radgridview settings:
Itemssource = "{binding pagedsource, elementname = raddatapager }"
2. Set the page control to source.
This. raddatapager. Source = employees;
Or source = "{binding datasouce, mode = twoway }"
If you have left-side navigation, you only need to throw the filtered data source to the paging control. If you have other data sources, the paging control is used for processing.

I prefer itemssource = "{binding pagedsource, elementname = raddatapager }"
This sentence is amazing.

<UserControl x:Class="SilverlightApplication2.MainPage"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"       xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"       mc:Ignorable="d"    d:DesignHeight="300" d:DesignWidth="400">    <Grid x:Name="LayoutRoot"        Background="White">        <Grid.RowDefinitions>            <RowDefinition />            <RowDefinition Height="Auto" />        </Grid.RowDefinitions>        <telerik:RadGridView x:Name="radGridView"                            ItemsSource="{Binding PagedSource, ElementName=radDataPager}"                            AutoGenerateColumns="False">            <telerik:RadGridView.Columns>                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" />                <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyName}" />                <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}" />            </telerik:RadGridView.Columns>        </telerik:RadGridView>        <telerik:RadDataPager x:Name="radDataPager"                            Grid.Row="1"                            DisplayMode="All"                            PageSize="5"                            Margin="0,10,0,0" />    </Grid></UserControl>

 

using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using System.Collections.ObjectModel;namespace SilverlightApplication2{    public partial class MainPage : UserControl    {        public MainPage()        {            InitializeComponent();            ObservableCollection<Employee> employees = new ObservableCollection<Employee>();            employees.Add(new Employee("Maria Anders", "Alfreds Futterkiste", "Sales Representative"));            employees.Add(new Employee("Ana Trujillo", "Ana Trujillo Emparedados y helados", "Owner"));            employees.Add(new Employee("Antonio Moreno", "Antonio Moreno Taqueria", "Owner"));            employees.Add(new Employee("Thomas Hardy", "Around the Horn", "Sales Representative"));            employees.Add(new Employee("Hanna Moos", "Blauer See Delikatessen", "Sales Representative"));            employees.Add(new Employee("Frederique Citeaux", "Blondesddsl pere et fils", "Marketing Manager"));            employees.Add(new Employee("Martin Sommer", "Bolido Comidas preparadas", "Owner"));            employees.Add(new Employee("Laurence Lebihan", "Bon app'", "Owner"));            employees.Add(new Employee("Elizabeth Lincoln", "Bottom-Dollar Markets", "Accounting manager"));            employees.Add(new Employee("Victoria Ashworth", "B's Beverages", "Sales representative"));            employees.Add(new Employee("Thomas Hardy", "Around the Horn", "Sales Representative"));            employees.Add(new Employee("Hanna Moos", "Blauer See Delikatessen", "Sales Representative"));            employees.Add(new Employee("Frederique Citeaux", "Blondesddsl pere et fils", "Marketing Manager"));            employees.Add(new Employee("Martin Sommer", "Bolido Comidas preparadas", "Owner"));            employees.Add(new Employee("Laurence Lebihan", "Bon app'", "Owner"));            employees.Add(new Employee("Elizabeth Lincoln", "Bottom-Dollar Markets", "Accounting manager"));            employees.Add(new Employee("Victoria Ashworth", "B's Beverages", "Sales representative"));            this.radDataPager.Source = employees;        }    }    public class Employee    {        public Employee(string name, string companyName, string title)        {            this.Name = name;            this.CompanyName = companyName;            this.Title = title;        }        public string Name        {            get;            set;        }        public string CompanyName        {            get;            set;        }        public string Title        {            get;            set;        }    }}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.