using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Demos
{
?///
??#region Web 窗体设计器生成的代码
??override protected void OnInit(EventArgs e)
??{
???//
???// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
???//
???InitializeComponent();
???base.OnInit(e);
??}
??
??///
??}
??#endregion
??public void Bind()
??{
???Pub.BindSql(aaa.Sel,this.Gridaaa);
???Pub.BindSql(bbb.Sel,this.Gridbbb);
??}
??private void Gridaaa_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","this.style.backgroundColor='Silver'");
????e.Item.Attributes.Add("onmouseout","this.style.backgroundColor='white'");
???}
??}
??private void Gridbbb_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
??{
???if(e.Item.ItemType==ListItemType.Item? || e.Item.ItemType==ListItemType.AlternatingItem )
???{
????e.Item.Cells[0].Attributes.Add("onmouseover","this.style.backgroundColor='#cccc99'");
????e.Item.Cells[0].Attributes.Add("onmouseout","this.style.backgroundColor='white'");
????//
????e.Item.Cells[0].Style["cursor"] = "hand";
????//
????e.Item.Cells[0].Attributes.Add("onclick", "alert('You click at ID: " +e.Item.Cells[0].Text + "!');");
???}
??}
??private void Gridaaa_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
??{
???this.Gridaaa.CurrentPageIndex=e.NewPageIndex;
???Pub.BindSql(aaa.Sel,this.Gridaaa);
??}
??private void Gridbbb_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
??{
???this.Gridbbb.CurrentPageIndex=e.NewPageIndex;
???Pub.BindSql(bbb.Sel,this.Gridbbb);
??}
?}
}