In that case use the item databound event to add a onmouseover javascript to
each cell.
The script will need to have an if then that checks the current value and
set's it to the opposite value on mouse over.
I have some simlar code:
1.. Private Sub DataGrid1_ItemD ataBound(ByVal sender As System.Object,
ByVal e As System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
DataGrid1.ItemD ataBound
2.. Try
3.. Dim itemType As ListItemType = e.Item.ItemType
4..
5.. If ((itemType = ListItemType.Pa ger) Or (itemType =
ListItemType.He ader) Or (itemType = ListItemType.Fo oter)) Then
6.. Return
7.. Else
8.. '---You'll have to change the code that get's the link button to
reflect the proper zero based column index:
9.. Dim button As LinkButton = CType(e.Item.Ce lls(3).Controls (0),
LinkButton)
10.. e.Item.Attribut es("onClick") =
Page.GetPostBac kClientHyperlin k(button, "")
11..
12.. '---Note that I've used javascript to show the cursor as a pointer
when a row is hovered over so that users will know it's clickable.
13.. e.Item.Attribut es.Add("onMouse Over",
"javascript
:thi s.style.cursor= 'pointer';")
14.. e.Item.Attribut es.Add("omMouse Out",
"javascript
:thi s.style.cursor= 'normal';")
15.. End If
16.. Catch ex As Exception
17.. '---Handle Exception
18.. End Try
19.. End Sub
It's the onmouseover portion you'll want to pay attention to. Also, this
code is adding the javascript to the entire row. You'll want to specify
adding it to each cell within e.Item (e.Item is the row).
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"ruca" <ru***@iol.pt > wrote in message
news:OZ******** *****@TK2MSFTNG P12.phx.gbl...
Justin,
Yes, something like that. But the cells must be followed, because we are
talking about select days of a calendar.
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> escreveu na
mensagem news:%2******** ********@tk2msf tngp13.phx.gbl. .. Ruca,
Do you mean you want to be able to hover over (or click) on a cell
clientside and have it highlight?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"ruca" <ru***@iol.pt > wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl... Hi,
Thank's, but it is not whta I really want.
I want to select single cells (but they must be followed) and paint them
selfs.
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate. com> escreveu
na mensagem news:eK******** ******@tk2msftn gp13.phx.gbl...
Ruca,
See if this article helps:
http://www.codeproject.com/aspnet/PrettyDatagrids.asp
One part of it show how to highlight single cells based on data values
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"ruca" <ru***@iol.pt > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
> Hi,
>
> Can anyone give me examples of how can I hightlight cells of my
> datagrid? I know that I must use ItemBound event and probably
> JavaScript.
>
> The thing is that I have a anual calendar, constructed in a DataGrid.
> Then what I want is select a range of two dates in that same calendar
> to do any action.
>
>
> Can anyone gives me examples??????
>
>
>
>
> --
> Programming ASP.NET with VB.NET
> Thank's (if you try to help me)
> Hope this help you (if I try to help you)
> ruca
>