protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
int i;
for (i = 0; i < GridView1.Rows.Count; i++)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#FFFFCC'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
e.Row.Attributes["style"] = "Cursor:hand";
}
dropdownlist选中值
drop1.Items.FindByValue("5").Selected=true;
drop1.Items.FindByText("hello").Selected=true;