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

highlight row in datagrid

i know how to highlight row in the datagrid, but how to deselect the row
when user click another one.
Nov 19 '05 #1
4 2266
To deselect :
DataGrid1.SelectedItem = -1
"Grey" wrote:
i know how to highlight row in the datagrid, but how to deselect the row
when user click another one.

Nov 19 '05 #2
Check out this article,
http://www.microsoft.com/india/msdn/...0DataGrid.aspx

--
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com

"Grey" <er*****@i-cable.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
i know how to highlight row in the datagrid, but how to deselect the row
when user click another one.

Nov 19 '05 #3
If you are talking about client side highlighting, you should just keep a
reference to the selected row in a variable and apply to it visual
properties for unselected row just before making another one selected.

Eliyahu

"Grey" <er*****@i-cable.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
i know how to highlight row in the datagrid, but how to deselect the row
when user click another one.

Nov 19 '05 #4
This is the code for client side :
var selectedRow = null;
function fnSelectRow(rowObject)
{

if (selectedRow != null)
{
selectedRow.style.backgroundColor = '#ffffff';
}
selectedRow = rowObject;
selectedRow.style.backgroundColor = '#CAD3E4';
}

this function should be called on e.attributes.add("onclick"
,"javascript:fnselectRow(this)").

I am having the problem to select all the rows when i click the checkbox in
the Datagrid.

"Eliyahu Goldin" wrote:
If you are talking about client side highlighting, you should just keep a
reference to the selected row in a variable and apply to it visual
properties for unselected row just before making another one selected.

Eliyahu

"Grey" <er*****@i-cable.com> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
i know how to highlight row in the datagrid, but how to deselect the row
when user click another one.


Nov 19 '05 #5

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

Similar topics

1
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As...
4
by: mike | last post by:
I'm trying to highlight a specific row in a datagrid who's contition matches ..text = "Dawn" i've been playing with the code below without much luck, is there a foreach loop i could do, like (...
1
by: TJS | last post by:
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...
4
by: Chris | last post by:
I've searched, reviewed, and attempted dozens of code ideas on the subject. I can't seem to get something that seems so simple to work. To highlight a row in a datagrid based on another value in...
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: Geraldine Hobley | last post by:
Hello I have a datagrid, called MyDataGrid and I wish to put the focus on a particular cell in order that the user to highlight the fact that the user needs to enter a value in this cell, e.g. I put...
0
by: Savvas | last post by:
Hi, I am using VB.Net 2005 for a windows application. The application was actually upgraded from vb.net 2003. I have a search field which is used as a parameter to search all datagrid...
0
by: rn5a | last post by:
How to highlight a row in a DataGrid that has just been edited? EditItemStyle-BackColor will highlight a row when the DataGrid (& a row) is in the editable mode. I want to highlight the row...
0
by: Nhan | last post by:
hi everyone, I have an interesting question to ask. I had created a datagrid to display the data from a .xls file. I want to highlight the rows which has the first three fields are the same. for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.