Welcome Guest Search | Active Topics | Sign In | Register

Grid Footer Format Options
David
Posted: Tuesday, November 22, 2011 6:05:32 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
I have a grid that I have enabled paging on. The pages display under the grid like Page [1] in black text. How can I change the style of this text. For example I would like to change the font color of it.
eo_support
Posted: Wednesday, November 23, 2011 10:29:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to set these two properties:

http://doc.essentialobjects.com/library/1/eo.web.grid.pagebuttonformat.aspx
http://doc.essentialobjects.com/library/1/eo.web.grid.currentpagebuttonformat.aspx

In these two properties, you would use "{0}" in place of the page number. For example, if you set PageButtonFormat to "<div style='color:red'>{0}</div>", then for page number "1" it will show as "<div style='color:red'>1</div>".

Thanks


David
Posted: Wednesday, November 23, 2011 3:56:01 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
I set the PageButtonFormat as you suggested but that did not change anything. I then tried setting the CurrentPageButtonFormat to the same value as PageButtonFormat but I get the error: Specified cast is not valid.

What should I be setting the CurrentPageButtonFormat to?
Also can you show me an example on how to use the PagerLabelTemplate and FirstPageButtonHtml grid properties.

Thanks,

David
eo_support
Posted: Wednesday, November 23, 2011 4:30:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The code we posted is correct. So if it does not make a difference, then something else is wrong. In that case you can try to create a simple test page that demonstrates the problem and post the test page. We will be very happy to take a look once we have that.

CurrentPageButtonFormat has the same format as PageButtonFormat. So in theory you can set them both to the same. The reason that there are two different properties is in case you MAY want to have different styles for the "current page" button and other page buttons. For example, some people wants the current page number to be bold and black, then you can set it to something like <b style='color:black;'>{0}</b>. Some other people wants the current page number to be gray to indicate that it's not clickable (since you are already on the current page). The idea is you use whatever HTML that fits your need. Just use {0} as a place holder in your HTML so that we can replace that with the real page number.

Hope this helps. Feel free to let us know if you still have any more questions.

Thanks!
David
Posted: Wednesday, November 23, 2011 4:52:03 PM
Rank: Advanced Member
Groups: Member

Joined: 10/21/2009
Posts: 39
Can you show me an example on the usage of the PagerLabelTemplate and FirstPageButtonHtml grid properties.

Thanks,

David
eo_support
Posted: Wednesday, November 23, 2011 5:03:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can set FirstPageButtonHtml to anything. There is no rule about that property.

As to PagerLabelTemplate, the default value is "{var:total_pages} page(s)&nbsp;&nbsp;". You can see this value in Visual Studio's property window. You can find detailed format information about this property in the reference section (the same section that contains reference information for PageButtonFormat and CurrentPageButtonFormat property).

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.