PagerTextFormat is ignored

8 posts, 0 answers
  1. Karen
    Karen avatar
    27 posts
    Member since:
    Jul 2008

    Posted 24 Oct 2008 Link to this post

    Hi

    My page style is the following

    <PagerStyle Mode="NumericPages" PagerTextFormat="Pages: {4}"></PagerStyle>

    The pager looks like this "1 2"

    If I put

    <PagerStyle PagerTextFormat="Pages: {4}"></PagerStyle>

    The pager looks like this "Pages: < >"

    What do I do wrong? When I set Mode="NumericPages" it completely ignores the PagerTextFormat, if  I remove Mode it considers PagerTextFormat but doesn't show page numbers only image arrows.
  2. Daniel
    Admin
    Daniel avatar
    4944 posts

    Posted 24 Oct 2008 Link to this post

    Hello Karen,

    Please elaborate a bit on the desired functionality in order to give you more to-the-point answer.

    In the meantime I suggest you to take a look at the following article:
    Using PagerTextFormat

    Short quotes from the mentioned document:

    "You can set the format of the text that appears in the Pager (when Mode is "NextPrev" or "NextPrevAndNumeric") using the PagerTextFormat property. The value of this property is an ASP.NET string formatting string."

    "{4} indicates where the next and previous page buttons appear. "


    The default mode is NextPrev. I hope this helps

    Best regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Karen
    Karen avatar
    27 posts
    Member since:
    Jul 2008

    Posted 24 Oct 2008 Link to this post

    Hello

    thanks for your answer,

    the desired view of pager I want to achieve is the following

    Pages: 1 2 3 4 5

    But I got Either "1 2 3 4 5" or "Pages: < >"
  5. Karen
    Karen avatar
    27 posts
    Member since:
    Jul 2008

    Posted 24 Oct 2008 Link to this post

    The problem is narrowed to question how to remove next and prev buttons if I want to use PagerTextFormat ?

  6. Daniel
    Admin
    Daniel avatar
    4944 posts

    Posted 24 Oct 2008 Link to this post

    Hello Karen,

    You may test this approach (combined with Mode="NumericPages"):

    C#
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
        Label label1 = new Label(); 
        label1.ID = "label1"
        label1.Text = "Pages: "
        if (e.Item is GridPagerItem) 
            e.Item.Cells[0].Controls[0].Controls.AddAt(0, label1); 

    VB
    Protected Sub RadGrid1_ItemCreated(ByVal sender As ObjectByVal e As GridItemEventArgs) 
        Dim label1 As New Label() 
        label1.ID = "label1" 
        label1.Text = "Pages: " 
        If TypeOf e.Item Is GridPagerItem Then 
            e.Item.Cells(0).Controls(0).Controls.AddAt(0, label1) 
        End If 
    End Sub 

    Regards,
    Daniel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 13 Mar 2009 Link to this post

    Hi guys,

    After upgrading to Q1 2009, and using slider for pagermode, I get a new itemcounter in the right side of the footer. Which is fine, but once I try to translate the message it disappears.

    So this: grid.PagerStyle.PagerTextFormat = "Liðir {2} til {3} af {5}" equals empty message while this: grid.ClientSettings.ClientMessages.PagerTooltipFormatString = "Síða {0} af {1}" still works.

    Regards,
    -DJ-


  8. Daniel
    Admin
    Daniel avatar
    4944 posts

    Posted 17 Mar 2009 Link to this post

    Hello DJ,

    Test the following:
    RadGrid1.ClientSettings.ClientMessages.PagerTooltipFormatString = "Síða {0} af {1}"
    RadGrid1.PagerStyle.PagerTextFormat = "{4}Item {2} to {3} of {5}"

    Let me know whether this helps.

    Best regards,
    Daniel
    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.
  9. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 17 Mar 2009 Link to this post


    Hi Daniel,

    Works perfectly, was a bit clumsy approach at my end obviously.

    Regards,
    -DJ-
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017