|
发表于 2020-8-16 10:00:02
|
显示全部楼层
private void dg_data_ItemDataBound(object sender, DataGridItemEventArgs e)
{
if(e.Item.ItemIndex<0) return;
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView)e.Item.DataItem;
ID=drv["faci_code"].ToString();
e.Item.Attributes.Add("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='C2F8F8'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor");
e.Item.Attributes.Add("onclick","window.open('reservation_faci_updDel.aspx?faci_code="+ID+"&code="+Request.QueryString["code"]+"','_self')");
// e.Item.Attributes.Add("onclick","window.open()");
}
}
这是第一个datagrid的响应事件 |
|