473,388 Members | 1,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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.ItemType == ListItemType.Item) || (e.Item.ItemType ==
ListItemType.AlternatingItem) || (e.Item.ItemType ==
ListItemType.SelectedItem))
{
((LinkButton)e.Item.Cells[8].Controls[0]).CssClass =
"Bold_Black_9pt_Sans_0000";
}

if(e.Item.ItemType == ListItemType.Header)
{
((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 1123

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

Similar topics

1
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...
2
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...
2
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...
1
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...
0
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...
1
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...
1
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,...
5
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.