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

Show Items of grid when no paging

2 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nguyen
Top achievements
Rank 1
nguyen asked on 27 Aug 2012, 08:10 AM
Dear all,

 I have a problem: When i load all data from datasource on 1 page (no paging), There is no pager style. But now i want to Show number of items when no paging.

the style like the pic attached. (when datasource is 5, i want to show "Items: 5" on the header)

thank you very much!

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 29 Aug 2012, 12:46 PM
Hi Nguyen,

Could you please try the following approach and let me know about the result?
<PagerStyle Position="Top" AlwaysVisible="true" PagerTextFormat="{4} Items: {5}" />

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
nguyen
Top achievements
Rank 1
answered on 30 Aug 2012, 03:07 AM
hi Eyup ,
i have resolved this problem and this is my solution:

radgrid.AllowPaging = false;
                radgrid.Rebind();

                radgrid.AllowPaging = true;
                radgrid.PageSize = radgrid.MasterTableView.Items.Count;
                radgrid.PagerStyle.AlwaysVisible = true;

and i use

<PagerStyle Position="Top" AlwaysVisible="true" PagerTextFormat="{4} Items: {5}" />
and then i Use this code
var Literal = new Literal();
var itemsCount = new StringBuilder();
            itemsCount.Append("<style type=\"text/css\">");
            itemsCount.Append(".rgArrPart1, .rgNumPart, .rgArrPart2, .rgAdvPart{");
            itemsCount.Append("display: none !important;");
            itemsCount.Append("}");
            itemsCount.Append(" </style>");
            ltItemsCount.Text = itemsCount.ToString();

thank you for your reply!
Tags
Grid
Asked by
nguyen
Top achievements
Rank 1
Answers by
Eyup
Telerik team
nguyen
Top achievements
Rank 1
Share this question
or