0

hi,

I want to draw the line in starting point of the column where the mousepointer is. Example
I have 5 columns in the datagridview and the mouse pointer is at 3 column means that column must indicate with a line at the begning of the columnindex 3.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Dabuskol
0

ASPX.CS
private void GridView_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
e.Item.Attributes.Add("onMouseOver", "SetNewColor(this);");
e.Item.Attributes.Add("onMouseOut", "SetOldColor(this);");
}
}

ASPX
<script language="javascript">
function SetNewColor(source)
{
_oldColor = source.style.backgroundColor;
source.style.backgroundColor = '#FFCCCC';//#FFCCCC';
source.style.cursor='hand';
}

function SetOldColor(source)
{
source.style.backgroundColor = _oldColor;
}
</script>

Hope this will help you atleast.

Regards
Dabuskol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.