473,978 Members | 34,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Highlighting row in Gridview using Onmouseover

I am trying to get it so when I go over a row in a gridview it will
highlight the row. I have looked at some examples but can't get it to
work.

Protected Sub GridView1_RowDa taBound(ByVal sender As Object, ByVal
e As System.Web.UI.W ebControls.Grid ViewRowEventArg s) Handles
GridView1.RowDa taBound
If (e.Row.RowType = DataControlRowT ype.DataRow) Then
e.Row.Attribute s.Add("onmouseo ver",
"this.style.bac kgroundcolor='b lue'")
e.Row.Attribute s.Add("onmouseo ut",
"this.style.bac kgroundcolor='w hite'")
End If
End Sub

Feb 13 '06 #1
0 2154

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

Similar topics

4
2288
by: WebMatrix | last post by:
Hello, I need to extend functionality of ASP.NET datagrid. Onmouse over, the whole row needs to be highlighted. OnClick highlighted color must remain, and the value of one of the columns must be set to innerHTML property of a <div> tag (no postBack). Has anyone done anything like that?
0
1783
by: kieran | last post by:
Hi, I was using the datagrid and am now starting to use the gridview in asp.net 2.0. I used to use the first below sub for when i would mouseover a row - this highlighted the row but did not affect the original colour of the datagrid on mouseout. My datagrid uses alternating row colours. However when i try and amend the code for the gridview - when i do a onmouseout all rows now go to a white backgound and the alternating colours in...
2
2809
by: Rob Roberts | last post by:
I am trying to figure out a way to add onmouseover and onmouseout events to ButtonFields in a GridView in order to give them a rollover effect, but so far I haven't been able to figure out a way to do it. Does anyone know how to do this? Thanks in advance, --Rob Roberts
3
14346
by: Rob Roberts | last post by:
Is there any way to add attributes to GridView ButtonFields? I'm looking for a way to add event handlers to ButtonFields. With regular ASP.NET buttons, I can add event handlers by using the Attributes collection, like this: MyButton.Attributes.Add("onmouseover", "this.className='actionH'"); MyButton.Attributes.Add("onmouseout", "this.className='actionN'"); But the GridView ButtonField doesn't seem to have an Attributes property. Is...
4
6113
by: lord.zoltar | last post by:
I am wondering how you guys highlight cells or rows (by changing the text or background colour) in a DataGridView. Right now, I apply styles to certain rows or cells in the CellFormatting even handler, but the way it works is by looping through all of the rows and then deciding if that rows needs special formatting. The problem is that I don't think this method will scale well. I have a dataset with 5,000 rows (and others are larger, this...
1
2033
by: mikename | last post by:
Hi, I'm currently working on a project which is essentially a clickable world map. I have successfully mapped the image and using a OnMouseOver = "Continent()" OnMouseOut = "World()" command in each mapping line ie. <area shape="poly" onmouseover="NA()" onmouseout="World()" coords="(lotsonumbers)". In my continent functions I change the image using something like: function Africa()...
4
3518
by: snowrupa | last post by:
my .cs file is using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
1
1890
by: thetechgeek | last post by:
Hey all, I've created a pretty nice-looking drop-down menu, and I need to prevent users form highlighting the text in the menu item, because it looks kind of ugly. Here's an snippet of my menu structure: <div id="menu"> <ul> <li><a class="first_btn" id="file_btn" onClick="ShowHideFile();">File</a> <ul id="file" onmouseover="OverFileMenu();" onmouseout="OutFileMenu();"> <li><a...
4
12045
by: BiffMaGriff | last post by:
Hello, I have a GridView that I put inside an update panel. I have a control that attaches to the datasource of the gridview that filters the data, databinds the gridview and then updates the update panel that the gridview is in. In my page render I put this so I could select a row by just clicking it. protected override void Render(HtmlTextWriter writer) {
0
10356
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
11826
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...
0
11416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10919
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...
0
10087
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8464
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
6561
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3769
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.