This is a migrated thread and some comments may be shown as answers.

How to Implement Paging by using Silder Mode

3 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ranganath
Top achievements
Rank 1
Ranganath asked on 12 Jun 2008, 01:18 PM

HI ,

I tried following code to implement paging Concept  by using <PagerStyle Mode="Slider>.

Aspx:-

<div>

   

        <!-- content start -->

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

            <AjaxSettings>

                <telerik:AjaxSetting AjaxControlID="RadGrid1">

                    <UpdatedControls>

                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

                    </UpdatedControls>

                </telerik:AjaxSetting>

                <telerik:AjaxSetting AjaxControlID="rcbPagerMode">

                    <UpdatedControls>

                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

                        <telerik:AjaxUpdatedControl ControlID="rcbPagerMode" />

                    </UpdatedControls>

                </telerik:AjaxSetting>

            </AjaxSettings>

        </telerik:RadAjaxManager>

<!----->

   

        <telerik:RadComboBox ID="RadComboBox1" Runat="server" Skin="Telerik">

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

        </telerik:RadComboBox>

   

        <telerik:RadGrid ID="RadGrid1" Skin="WebBlue" runat="server" AllowPaging="True" AllowCustomPaging="True"

            PageSize="10" onneeddatasource="RadGrid1_NeedDataSource" >

            <MasterTableView VirtualItemCount="100" />

            <PagerStyle Mode="Slider"></PagerStyle>

        </telerik:RadGrid>

 

   

    </div>

Aspx.cs:-

protected void Page_Load(object sender, EventArgs e)

    {

        SqlConnection con = new SqlConnection("server=.;database=Pubs;trusted_connection=true");

        SqlDataAdapter dap = new SqlDataAdapter("select * from authors", con);

        DataSet ds = new DataSet();

        dap.Fill(ds, "authors");

this.RadGrid1.DataSource = ds.Tables[0];

        this.RadGrid1.DataBind();

 

    }

    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

    {

       

    }

Please guide me to Implemet paging with above example…

 

Thanks,

Ranganath.S

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 13 Jun 2008, 07:02 AM
Hello Ranganath,

Please, move the binding code from Page_Load into NeedDataSource and let us know if you need further assistance:

    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        SqlConnection con = new SqlConnection("server=.;database=Pubs;trusted_connection=true"); 
        SqlDataAdapter dap = new SqlDataAdapter("select * from authors", con); 
        DataSet ds = new DataSet(); 
        dap.Fill(ds, "authors"); 
        this.RadGrid1.DataSource = ds.Tables[0] 
    } 


All the best,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Princy
Top achievements
Rank 2
answered on 13 Jun 2008, 07:11 AM
Hi,

 You should never call the DataBind() method from inside the NeedDataSource handler or mix simple data-binding mode with advanced data-binding.

Thanks
Princy.
0
Deboshree
Top achievements
Rank 1
answered on 23 Sep 2008, 01:04 PM
Hi,
I just want an example of how to implement paging through Slider mode without using onneeddatasource, i am using only itemDataBound and itemcreated events.
Tags
Grid
Asked by
Ranganath
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Princy
Top achievements
Rank 2
Deboshree
Top achievements
Rank 1
Share this question
or