Add handler for RowCreated/RowDataBound event for the grid and in this event add the attributes for onmouseover and onmouseout javascript events.
Code :
If e.Row.RowType = DataControlRowType.DataRow Then
Dim gv As GridView = CType(sender, GridView)
Dim className As String = Microsoft.VisualBasic.IIf((e.Row.RowState = DataControlRowState.Alternate), gv.AlternatingRowStyle.CssClass, gv.RowStyle.CssClass)
e.Row.Attributes.Add("onmouseover", "this.className='datagrid_hovcol';")
e.Row.Attributes.Add("onmouseout", "this.className='" + className + "';")
End If
In this code "onmouseover" specify classname directly. And in "onmouseout" find dynamically which class is specify for Normal /Alternative Row.
And also this code for highlight row.But if you want to highlight particular cell of row then change
e.Row.Cells(1).Attributes.Add("onmouseover", "this.className='datagrid_hovcol';")
e.Row.Cells(1).Attributes.Add("onmouseout", "this.className='" + className + "';")
|
| Author: sreejith 21 Feb 2008 | Member Level: Silver Points : 0 |
its really nice to read the article.simple presentation. really good.
sreejithsql@gmail.com
|