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

RadGrid Pager text not rendering

3 Answers 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 24 Aug 2012, 09:11 AM
I can't seem to get the pager text of a RadGrid to render.
We're not doing anything special, am I not seeing something?

ASPX:
<rad:RadGrid ID="rgBestellingen" runat="server" AllowPaging="True" runat="server" GridLines="None" Width="90%">
    <MasterTableView>
        <PagerStyle Mode="NextPrevAndNumeric" HorizontalAlign="Right"></PagerStyle>
    </MasterTableView>
</rad:RadGrid>

CS:
public partial class Test : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        List<string[]> items = new List<string[]>(50);
        for (int i=0;i<50;i++)
            items.Add(new string[3] { "1", "2", "3" });
 
        rgBestellingen.DataSource = items;
        rgBestellingen.VirtualItemCount = items.Count;
        rgBestellingen.Rebind();
    }
}

But the grid always renders as in the screenshot. Can anyone help?

John

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 28 Aug 2012, 11:30 AM
Hello John,

Please note that performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Paging, Sorting, Filtering require accommodating appropriate database operations. To use them with simple databinding you will need to declare custom event handling for every operation which requires binding to your DataSource. Therefore, in this case we strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
Declarative DataSource
Advanced Data Binding
Advanced Data Binding Demo

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
John
Top achievements
Rank 1
answered on 28 Aug 2012, 12:16 PM
Hello Eyup,

Thanks for the response.
I changed the databinding to be as below, but I still don't get the total item counts.
Can you help me further?

ASPX:
<rad:RadGrid ID="rgBestellingen" runat="server" AllowPaging="True" runat="server" GridLines="None"
    OnNeedDataSource="rgBestellingen_NeedDataSource" Width="90%" PageSize="15" AllowSorting="True">
    <MasterTableView Width="100%" />
    <PagerStyle Mode="NextPrevAndNumeric" />
</rad:RadGrid>

CS:
public partial class Test : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    private DataTable GetDataTable()
    {
        DataTable dt = new DataTable("test");
        dt.Columns.Add("1");
        dt.Columns.Add("2");
        dt.Columns.Add("3");
 
        for (int i = 0; i < 50; i++)
            dt.Rows.Add("1", "2", "3");
        return dt;
    }
 
    protected void rgBestellingen_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        rgBestellingen.DataSource = GetDataTable();
    }
}

Hope you can help.
John
0
Eyup
Telerik team
answered on 30 Aug 2012, 12:50 PM
Hello John,

I have created a sample RadGrid web site using the provided code. On my side everything works as expected and the pager item correctly displays the data items count. Please check out the attached application and try to distinguish the crucial differences between our projects.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Eyup
Telerik team
John
Top achievements
Rank 1
Share this question
or