473,486 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HIGHLIGHTTTTTTTTTT a

Thank you, it is working fine.
but i want the row which i clicked to be highlighted
for example if i click 1 row it should get highlighted
then if i click 2 row 1st row should be in the default
format and 2nd row should get highlighted.

How can i achieve this?

Thank you

-----Original Message-----
You can add some code in your ItemDataBound event,like
this:

if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType== ListItemType.AlternatingItem){
e.Item.Attributes.Add
("onclick","this.style.backgroundColor='Silver'") ;
}
-----Original Message-----
I want to highlight a row in a ASP.NET datagrid when i
click on it ?

How can i do that?
.

.


Jul 21 '05 #1
1 1095
Tom

It's in vb, but you can try to use this :

Private Sub DataGrid1_MouseUp(ByVal sender As Object,
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
DataGrid1.MouseUp

Dim grdInfo As DataGrid.HitTestInfo = _
DataGrid1.HitTest(e.X, e.Y)
Me.DataGrid1.Select(grdInfo.Row)

End Sub

Tom
-----Original Message-----
Thank you, it is working fine.
but i want the row which i clicked to be highlighted
for example if i click 1 row it should get highlighted
then if i click 2 row 1st row should be in the default
format and 2nd row should get highlighted.

How can i achieve this?

Thank you

-----Original Message-----
You can add some code in your ItemDataBound event,like
this:

if(e.Item.ItemType == ListItemType.Item ||

e.Item.ItemType
== ListItemType.AlternatingItem){
e.Item.Attributes.Add
("onclick","this.style.backgroundColor='Silver'" );
}
-----Original Message-----
I want to highlight a row in a ASP.NET datagrid when i
click on it ?

How can i do that?
.

.


.

Jul 21 '05 #2

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

Similar topics

1
276
by: Hari | last post by:
Thank you, it is working fine. but i want the row which i clicked to be highlighted for example if i click 1 row it should get highlighted then if i click 2 row 1st row should be in the default...
0
7105
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
6967
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
7132
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
5439
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,...
1
4870
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...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
266
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...

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.