473,386 Members | 1,883 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,386 software developers and data experts.

mouseover highlight of datagrid row

TJS
trying to use this code for mouseover highlight of row but it is not working
on the datagrid, nothing happens.
Page compiles without errors but no highlighting effects take place.

can anyone tell me what is missing ?

Sub Grid_ItemDataBound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
'---------------------------------------------------
' Add the OnMouseOver and OnMouseOut method to the Row of DataGrid
'---------------------------------------------------
e.Item.Attributes.Add("onmouseover",
"this.style.backgroundColor='Silver'")
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='White'")
End If

End Sub
Nov 18 '05 #1
1 2235
Hi
The code is right
Please check the following
1. The 'asp:DataGrid ID' tag should have an ItemDataBound event mentioned
eg: <asp:DataGrid ID="ItemsGrid" AutoGenerateColumns="False" OnItemDataBound = "ItemsGrid_Bound" Runat="server"

2. Manually register the event-handling method (Grid_ItemDataBound in your case) for the ItemDataBound event of the data grid

It worked for me. Only diff is that my code was in C#

HT
Regards
-am
Nov 18 '05 #2

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

Similar topics

1
by: Michael Ramey | last post by:
I'm using the following code to highlight the current row: private void Datagrid1_CurrentCellChanged(object sender, System.EventArgs e) { DataGrid1.Select(DataGrid1.CurrentRowIndex); } The...
1
by: perspolis | last post by:
how can i highlight a row in the datagrid??
0
by: back2grid | last post by:
I'm basically looking for highlighting a datagrid row on selection a radio button control. the problem i'm having is that the event sender(radio btn) i'm getting is functioning as a checkbox. my...
2
by: Mike | last post by:
How can i highlight a row in my datagrid when the user clicks it? I can do this in VB.NET but my app is in C#.
6
by: LU | last post by:
A)I build a datagrid based on a calendar date selection. B)When user clicks a button column on the datagrid I want to highlight this row. I use the code below to highlight the row. ***** CODE...
2
by: Alex Maghen | last post by:
I'd like to set up the DataGrid so that as users rollover a row, that row is highlighted a different color and then goes back on roll-out. Any samples for how to set that up?
2
by: AndrewC | last post by:
I am using the Scriptaculous/Prototype libraries to build a project and I really want to have an effect like the mootools download page (http://www.mootools.net/download) where when you mouse over...
1
by: lisles | last post by:
hi; Im using a gridview to display images in 1 of the column...but the size of the images is very small.is there anyway to enlarge the image on mouseover or even without mouseover by adjusting the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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,...
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
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...

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.