|
 |
|
ASP.Net GridView เปลี่ยนสี Background เวลาเมาส์ เลื่อนผ่าน ไม่ได้ครับช่วยดูที่ครับ ผมลองทำตามตัวอย่าง แต่ผลเวลานำเมาส์ผ่าน ไม่มีไรเกิดขึ้นเลยครับ |
|
 |
|
|
 |
 |
|
ได้แล้วครับ พอดี ผมไม่รู้ว่า ที่.aspx ตรงแท็กของ GridView ต้องเลือก onRowDataBound ด้วย
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2009-05-12 13:04:31 |
By :
hassadin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (C#)
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes.Add("style", "cursor:help;");
if (e.Row.RowType == DataControlRowType.DataRow && e.Row.RowState == DataControlRowState.Alternate)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='orange'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#E56E94'");
e.Row.BackColor = Color.FromName("#E56E94");
}
}
else
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='orange'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='gray'");
e.Row.BackColor = Color.FromName("gray");
}
//e.Row.Cells[0].BackColor = Color.FromName("gray");
//e.Row.Cells[1].BackColor = Color.FromName("gray");
//e.Row.Cells[2].BackColor = Color.FromName("gray");
//e.Row.Cells[3].BackColor = Color.FromName("gray");
//e.Row.Cells[4].BackColor = Color.FromName("gray");
//e.Row.BorderWidth = 2;
//e.Row.BorderColor = Color.FromName("#43C6DB");
}
}
|
 |
 |
 |
 |
Date :
2013-12-19 17:49:04 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|