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

PagerTextFormat is ignored

7 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karen
Top achievements
Rank 1
Karen asked on 24 Oct 2008, 02:24 PM
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.

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 24 Oct 2008, 02:52 PM
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.
0
Karen
Top achievements
Rank 1
answered on 24 Oct 2008, 03:02 PM
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: < >"
0
Karen
Top achievements
Rank 1
answered on 24 Oct 2008, 03:18 PM
The problem is narrowed to question how to remove next and prev buttons if I want to use PagerTextFormat ?

0
Daniel
Telerik team
answered on 24 Oct 2008, 03:29 PM
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.
0
-DJ-
Top achievements
Rank 1
answered on 13 Mar 2009, 01:00 PM
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-


0
Daniel
Telerik team
answered on 17 Mar 2009, 02:10 PM
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.
0
-DJ-
Top achievements
Rank 1
answered on 17 Mar 2009, 03:47 PM

Hi Daniel,

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

Regards,
-DJ-
Tags
Grid
Asked by
Karen
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Karen
Top achievements
Rank 1
-DJ-
Top achievements
Rank 1
Share this question
or