battleangela
Technical User
Hi
I have a mouseover event for a data grind written in C#, the problem is I am now have to use VB in an asp.net page. Can someone help me with the syntax of it ? I am not that familiar with vb.net, so it been a hard time.
protected void MyGridView_RowCreated(object sender, GridViewRowEventArgs e)
{
string onmouseoverStyle = "this.style.backgroundColor='blue'";
string onmouseoutStyle = "this.style.backgroundColor='#@BackColor'";
string rowBackColor = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Alternate)
rowBackColor = MyGridView.AlternatingRowStyle.BackColor.Name.Remove(0, 2);
else rowBackColor = MyGridView.RowStyle.BackColor.Name.Remove(0, 2);
e.Row.Attributes.Add("onmouseover", onmouseoverStyle);
e.Row.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor",rowBackColor));
}
}
I have a mouseover event for a data grind written in C#, the problem is I am now have to use VB in an asp.net page. Can someone help me with the syntax of it ? I am not that familiar with vb.net, so it been a hard time.
protected void MyGridView_RowCreated(object sender, GridViewRowEventArgs e)
{
string onmouseoverStyle = "this.style.backgroundColor='blue'";
string onmouseoutStyle = "this.style.backgroundColor='#@BackColor'";
string rowBackColor = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Alternate)
rowBackColor = MyGridView.AlternatingRowStyle.BackColor.Name.Remove(0, 2);
else rowBackColor = MyGridView.RowStyle.BackColor.Name.Remove(0, 2);
e.Row.Attributes.Add("onmouseover", onmouseoverStyle);
e.Row.Attributes.Add("onmouseout", onmouseoutStyle.Replace("@BackColor",rowBackColor));
}
}