Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2006, 10:34 AM
Authorized User
 
Join Date: Mar 2006
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to anup_daware Send a message via MSN to anup_daware Send a message via Yahoo to anup_daware
Default Changing color of page-numbers in DataGrid

Hi group,

I m using protected System.Web.UI.WebControls.DataGrid (ASP.NET 1.x)


I have set the "pager style mode" to "NumericPages"


with "AllowingPaging=true"


Application works fine but the Problem is:-


I am not able change colour for selected page-number and visited
page-numbers.
(so that user could know the pager number which is being displayed)


I tried :-


dataGridDisplay.PagerStyle.ForeColor=System.Drawin g.Color.Red; on


PageIndexChanged event but this statement is changing colour of all
pagenumbers.


Please let me know if there is any way out.




Best Regards,
Anup
<Today is the first day of your rest of life.. Make most of it>
__________________
--Everything you can imagine is real.--
 
Old March 11th, 2006, 12:56 AM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Anup,
Here is the CSS solution for your problem. paste the following style code in your .aspx file and edit it as you need (search the internet for CSS tutorials if you don't know how to write Styles).

<style>
.mypager{
    font-family:verdana;
    font-weight: bold;
    font-size: 11pt;
    color: #ff9900;
}
.mypager A{
    font-family:verdana;
    font-size: 9pt;
    text-decoration: none;
    color: #0000ff;
}
</style>

this style basically sets the selected page number to color(#ff9900), font size 11pt and the rest of links to color(#0000ff or Blue) and size 9pt.

Assign "mypager" to the CssClass property of your PagerStyle tag (mypager is CSS class name).

<PagerStyle Mode="NumericPages" CssClass="mypager"></PagerStyle>

thats it, you are in good shape.

Good Luck,
Sai Puli
 
Old October 18th, 2007, 07:04 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have attempted this css style for my datagrid. In local computer it works OK, but after moving to the server I not see any change. Which cause can be here?

Thank you.
Boris






Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Page Color darkestangel1980 CSS Cascading Style Sheets 6 February 6th, 2008 12:40 PM
Datagrid row color changing - windows vb.net app badgolfer VS.NET 2002/2003 7 April 18th, 2007 02:32 PM
editing datagrid and changing cell color upon edit matoaka VS.NET 2002/2003 0 August 11th, 2006 11:04 AM
Changing color conny Visual C++ 0 April 14th, 2005 07:57 PM
changing datagrid row color msrnivas Classic ASP Components 4 August 5th, 2004 10:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.