473,799 Members | 3,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Hyperlinks/LinkButtons in Datagrid Pager

Hello,

I need to be able to access the linkbuttons that are used for paging
inside a datagrid so I can set the style for what eventually becomes
the client-side html anchor tags.

I have read several posts about using the datagrid's PagerStyle
property, but this solution is simply inadequate. This is because I
need to be able to apply a CssStyle so that I can get at a:hover and
other CSS properties. PagerStyle only applies the selected style into
the tablecell text, and not the html anchor tags that are generated
within.

So far I have managed to do this successfully for the anchor tags in
the header, item, and alternating item sections by using the code below
inside of the ItemDataBound event...

if((e.Item.Item Type == ListItemType.It em) || (e.Item.ItemTyp e ==
ListItemType.Al ternatingItem) || (e.Item.ItemTyp e ==
ListItemType.Se lectedItem))
{
((LinkButton)e. Item.Cells[8].Controls[0]).CssClass =
"Bold_Black_9pt _Sans_0000";
}

if(e.Item.ItemT ype == ListItemType.He ader)
{
((LinkButton)e. Item.Cells[1].Controls[0]).CssClass =
"Bold_White_9pt _Sans_0000";
((LinkButton)e. Item.Cells[2].Controls[0]).CssClass =
"Bold_White_9pt _Sans_0000";
((LinkButton)e. Item.Cells[3].Controls[0]).CssClass =
"Bold_White_9pt _Sans_0000";
((LinkButton)e. Item.Cells[4].Controls[0]).CssClass =
"Bold_White_9pt _Sans_0000";
((LinkButton)e. Item.Cells[5].Controls[0]).CssClass =
"Bold_White_9pt _Sans_0000";
}

....but so far I have found no solution to get at the anchor tags in the
pager section.

Any ideas?

Jan 23 '06 #1
0 1140

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1091
by: Ken Saganowski | last post by:
Not sure if this is the proper group to post this but its worth a shot: Is there a project property setting that gives hyperlinks and linkButtons the "rollover" effect with underlining? Right now, it is somehow defaulted to an automatic underline which I only want displayed when the user moves the pointer over the link. Any help would be grealy appreciated.
2
1422
by: Roy | last post by:
I am very, very new to ASP.NEt and have never done ASP. I have been trying to get a datagrid to work for about 5 days with very limited results. When I use property builder, bind the control, set the paging and populate it from the page_load event it works. However, if I set it as unbound, then set the properties through code the grid does not show. I check the dataset count and there are 43 rows. My first question is "Can a datagrid...
2
4000
by: Ben | last post by:
Hi, I'd like to have a datagrid that has a dropdownlist in the pager control for setting the page size. I can get the control into the pager inside the datagrid itemcreated event by checking for ListItemType.Pager. The problem I'm having is subscribing to the selectedindex changed event. The datagrid doesn't even seem fire an itemcommand, but that's ok, just the selectedindex changed event would do... Any advice is greatly appreciated!
1
2097
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to do format because it's in a Datagrid pager area. The html code generated for pager is one sigle cell with lots of colspan. I tried to add some html elements in between text and dropdownlist, for example table iframe and p but I cannot achieve...
0
1240
by: James T. | last post by:
Hello! I am using following code to customize DataGrid Pager. It works fine... My question is, how I can replace"&nbsp" with " | " between each LinkButton control? Thanks! James Dim pager As TableCell
1
3532
by: Friso Wiskerke | last post by:
Hi all, is it possible to set a separate style in a datagrid pager for the selected page to make it more clear for the user which page is selected? For example: page 3 is selected out of the 8 possible pages and the number 3 is then displayed in bold and with an alternate color. There's a pager style but there is no setting for the selected page. TIA
1
3711
by: JeffP | last post by:
I need to know when a link buttons value is zero so I don't try to run a query to find none. When I was using ViewState(ds_Last), which I can't do because certain phones are choking on the data, I have on avg about 12 rows of data. Apparently that's way too much data for some phones, nearing 30k. So I've abondoned ViewState and I'm trying to get the value from the datagrid, I see that it can be done but I may be missing something...
5
3129
by: Nathan Sokalski | last post by:
I have a FormView control in which I use a PagerTemplate. I am having trouble accessing the controls in the PagerTemplate. How do I access them, and in what event should I put the could that accesses them? My current code is as follows: Partial Public Class indextest : Inherits System.Web.UI.Page Private rowcount As Integer = 0 Protected Sub Page_Load(ByVal sender As Object, ByVal e As
0
2514
by: moondog | last post by:
Just in case anyone else out there is having the same problem of the page numbers appearing in one column instead of across the row, here's how to fix the problem courtesy of swn...@gmail.com from his original thread of this subject. Below are the C# and VB.NET code samples of the prerender event of the datagrid: C#:
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.