Till the 2009 Q1 release i have used "Change page: {4} | Displaying page {0} of {1}, items {2} to {3} of {5}" as discribed to localize the paging in the RadGrid. [RadGrid.PagerStyle.PagerTextFormat].
The RadGrid is set to: PagerStyle-Mode="NextPrevAndNumeric"
With the 2009 Q1 release, the pagingelements looks different:
|< < [pages] > >| page size: [Dropdown] [totalItems] items in [totalPages] pages
I use the "Office2007" skin, does this affect something?
What is the correct string to localize the new paging? I couldn't find any new examples ...
Regards and TIA,
Markus
26 Answers, 1 is accepted
You can use the same format to localize the paging in grid. I tried the following code and it worked as expected.
cs:
<telerik:RadGrid ID="RadGrid" AllowPaging="true" Skin="Office2007" PageSize="3" DataSourceID="SqlDataSource1" AutoGenerateColumns="true" runat="server"> |
<PagerStyle PagerTextFormat="{4} Custom DisplayingPage {0} Custom of {1}, Custom Items {2} Custom To {3} Custom Of {5}" Mode="NextPrevAndNumeric" /> |
<MasterTableView> |
.... |
Thanks
Princy.
For more information about paging in Q1 2009, please refer to the following live demo:
Basic Paging
Additionally you can use GridTableView.PagerTemplate for defining unique look and feel for the appearance and features of the pager item. All command buttons in the template can take advantage of the paging command API and event bubbling mechanism of the control. Custom commands can be handled in the ItemCommand event of Telerik RadGrid.
More information is available in the following demo:
Pager Template
I hope this helps.
Sincerely yours,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thanks for your answers.
@Pavlina: I don't want to use custom paging. I like the normal ones. I just want to localize it.
The problem is still excisting. Let me be more specific:
I had, prior to, 2009 Q1, following strings to localize it:
english: "Change page: {4} | Displaying page {0} of {1}, items {2} to {3} of {5}"
german: "Blättern: {4} | Seite {0} von {1}, Einträge {2} bis {3} von {5}"
The result was as expected for the "NextPrevAndNumeric" mode.
Now, in 2009 Q1, Telerik changed the look of the "NextPrevAndNumeric" mode. It displays now the "Page size: [Dropdown]" within the paging footer.
I still don't see how to change the "Page size: " string. I have the string set as suggested, but the "Page size: " is unchanged and it's always visible. It looks to me it is hardcoded somewhere in the generate paging routine and can't be localized.
Please, can you provide me with the normal, english PagerTextFormat-String used in 2009 Q1 for the "NextPrevAndNumeric" mode? I just have to know, which parameter i have to use, that i can change the "Page size:" string.
Thanks
Markus
PS: Why does Telerik changes a look of an existing, predefined Pager-Mode? If they want to extend the looks and behaviors of the paging, create a new mode. I can't check after every release, what is still working and what does not!
I couldnt be more agree than what Markus has to say in his note " If they want to extend the looks and behaviors of the paging, create a new mode." because no one would like to go do re-work and figure out what is still working and what does not!.
Anyway, one way I found to handle pagesize string and combobox is as below.
I have hidden that element of page footer in some pages and in some pages increase the width of combo so that it does not display scrollbars.
- following code can be written either in Radgrid1_Itemcreated() / Radgrid1_Itembound() event
To change the pagesize string or combo width
if (e.Item is GridPagerItem)
{
RadComboBox cmbPageSize = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
if(cmbPageSize != null)
cmbPageSize.Width = 50;
Label lbPageSize = (Label)e.Item.FindControl("ChangePageSizeLabel");
if(lbPagesize != null)
lbPageSize.text = "whatever text you want";
}
To hide the pagesize string and combo.
if (e.Item.ItemType == GridItemType.Pager)
{
RadComboBox cmbPageSize = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
if(cmbPageSize != null)
cmbPageSize.Visible = false;
Label lbPageSize = (Label)e.Item.FindControl("ChangePageSizeLabel");
if(lbPagesize != null)
lbPageSize.Visible = false;
}
If I understood your query right than this might give u some idea about what you wanted to do.
thanks
Div
Thanks a lot for your answer, it works now!
Let's hope it wont be changed the next release ...
Thanks,
Markus
I apologize that the information you need for accessing controls in the new default grid pager (NextPrevAndNumeric) is not available in the present version of the documentation. However, you may be happy to know that it will be included with the next build of the online help, expected by the end of this week. These are the articles which will hold the updated content:
http://www.telerik.com/help/aspnet-ajax/grdaccessingdefaultpagerbuttons.html
http://www.telerik.com/help/aspnet-ajax/grdusingpagettextformat.html
Kind regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I still have a problem with PagerTextFormat with my pages.
In earlier version of RadGrid I had an additional link "show all" at the end of the pageTextFormat. I used pagertemplate to do that but it seems the newer changes has broken it.
For somereason the newer numericpagerstyle is broken in 2 rows. because of what I have done with the pager format.
my pagetemplate is as below.
<
PagerTemplate>
<div style="padding: 2px; width: 760px;">
<div style="text-align: left; width: 39%; float: left;"><asp:Panel runat="server" ID="NumericPagerPlaceHolder" Direction="LeftToRight"></asp:Panel></div>
<div id="spnPagerTextFormat" runat="server" style="width: 59%; text-align: right; vertical-align: top; float: right;">Page
<%
# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
of
<%
# DataBinder.Eval(Container, "Paging.PageCount")%>: showing
<%
# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
to
<%
# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
of
<%
# DataBinder.Eval(Container, "Paging.DataSourceCount")%> items. <a id="lnkShowall" href="#" title="Show all items on one page." onclick="javascript:showall('<%# DataBinder.Eval(Container,"Paging.DataSourceCount")%>');">Show All</a>
</div>
</div>
</PagerTemplate>
As soon as upgrade telerik dll to 2009.1.311.35 this footer is broken.
First and prev button and text format is in 1 row and remaing buttons (i.e. page number buttons,next, last and page size combo) appears in second row. So my page footer is divided in 2 rows.
Any suggestions please.
Regards
Div
Further more to my previous thread, I think adding numericPagerControl programatically does not work. It breaks the NumericPagerControl in 2 rows.
Any update on this please.
Regards
Div
This use to work: <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" AlwaysVisible="true" PagerTextFormat="Showing {2} - {3} of {5}: {4}" Font-Size="10px" Font-Bold="true" FirstPageImageUrl="" NextPageImageUrl="" LastPageImageUrl="" PrevPageImageUrl=""/>
And it would display this: Showing 0 - 0 of 0: 1
now it looks like this:
I tend to agree that having to remake all skins from scratch after every new release isn't pure joy.
After going through these files:
http://www.telerik.com/help/aspnet-ajax/grdaccessingdefaultpagerbuttons.html
http://www.telerik.com/help/aspnet-ajax/grdusingpagettextformat.html
I still can't find a way to translate the "Page Size" string in front of the combobox when using GridPagerMode.NextPrevAndNumeric.
A side-note:
As far as I can tell the intellisense for the pagertooltips is wrong, it gives you:
grid.PagerStyle.PrevPagesToolTip and
grid.PagerStyle.NextPagesToolTip
which then don't result in errors, but don't give you translated tooltips either. Lose the plural s's and it works correctly.
Regards,
-DJ-
However, I don't think it's acceptable having to use the itemcreated event for translating one string, while you can translate everything else at page load for example.
This is why we need a single global and always the same approach to localization. As it is now you have to move all over the code to successfully translate many of the controls.
Regards,
-DJ-
Unfortunately, for the time being there is no solution to the page size label localization problem more elegant than the programmatic one.
I have forwarded this issue to our development team.
Excuse us for the inconvenience this might have caused you.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you, hopefully the dev team will look at this in positive light.
Regards,
-DJ-
I am sure you will take all this grief/comments from developer like me positively and we will get even better solution than this.
Currently the best thing for me to do was to remove the latest release and go back to old one rather than playing and messing about with all those pages.
Anyway, Best luck for future release.
Best Regards
Div
The goal we set with the new grid pagers was to improve their rendering/functionality as much as possible with minimal breaking changes (if at all) and at the same time make them more attractive and compliant with the new set of skins introduced for RadGrid for ASP.NET AJAX. Additionally, we will gladly assist anyone who would like to attain the previous look and feel of his/her grids.
If you are not content with the changes, feel free to revert to the previous version of the control or apply the old skins as external extracting them from the following sticky forum post:
http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-q3-2008-skins-available-for-download.aspx
Kind regards,
Sebastian
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
I was also affected by the skin changes as well and had to go back and restyle everything. We should be spending time developing functionality and instead I now have the extra work of styling. When trying to meet deadlines, these little nuances are not desirable.
Extending and enhancing is one thing, changing existing functionality that significantly alters the look and feel of a control was not a good thing IMO.
I agree with you, however these skin changes were necessary in order to unify the styles/the conventions for css class names of all RadControls and make them ready for the upcoming Visual Style Builder. This is discussed in the following blog post on our site:
http://blogs.telerik.com/tervelpeykov/posts/09-03-20/using_pre-q1_2009_skins_with_q1_2009.aspx
If you would like to hide the dropdown from the new default page (NextPrevAndNumeric) of RadGrid, consider referencing the RadComboBox in the pager on ItemCreated by its id and hide it.
Kind regards,
Sebastian
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
I spoke to our development team and they have deemed it unnecessary to localize this single label in the pager since its translation in code-behind is easy and straightforward.
Kind Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We understand your perspective as a customer and for later versions we will consider making the localization of the page size label easier.
Thank you for the understanding.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Without having any special longing to keep this thread going, I have to say this whole scenario feels badly planned and thrown together in such a hurry. The pagesize dropdown should have been introduced as an optional element.
To throw it in like this, where you have to translate it individually from other strings, or hide it by using the itemcreated event is ill-adviced as you can see by this thread.
If it was a simple property that you could set to false, we could all start playing nicely again.
Regards,
-DJ-
Upon the remarks posted in this forum discussion, our development team has decided to expose a public property in the pager style to set the text for the page-size label. Hopefully, this feature will be available for the next release.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Smart move indeed.
Give my best to the much discussed dev team.
Regards,
-DJ-
I just wanted to echo the displeasure voiced in this thread around the paging changes made in the last release. I was already handling the 2008/2009 Skin CSS changes when this issue came up. The inclusion of the Page Size Selector in NextPrevAndNumeric must surely be a bug plus the back compat of the paging text format could have been handled a lot better than it was. I applaud the regular release cycle but there should be a better way to warn of these sorts of "Breaking Changes". I see "What's New" and What's Fixed" in the Release Notes but not "What's Broken" and that is probably the most important section.
Thanks,
Brian
I can assure you that our goal is to constantly improve our products, thus making the developers' life easier. Inevitably at times this process involves trade-offs including the introduction of breaking changes. Those, however, we do our best to keep at minimum and resort to introducing such only when the advantages of the improvement outweigh the possible loss of backward compatibility.
In addition, we will gladly help anyone who hits any of these changes and has difficulty with his implementation.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.