1、提示+鼠标经过颜色
private void grid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
  {
   foreach(System.Web.UI.WebControls.HyperLink link in e.Item.Cells[7].Controls)
   {
    link.Attributes.Add("onClick","if (!window.confirm('您真的要删除这条记录吗?')){return false;}");
   }
   if(e.Item.ItemIndex>=0)
   {
    string title=Application[Session["Style"].ToString()+"xtable_titlebgcolor"].ToString();
    string bgcolor=Application[Session["Style"].ToString()+"xtable_bgcolor"].ToString();
    e.Item.Attributes.Add("onMouseOver","this.style.backgroundColor='"+title+"'; this.style.cursor='hand';");
    e.Item.Attributes.Add("onMouseOut","this.style.backgroundColor='"+bgcolor+"';"); 
   }
  }

2、有删除的绑定与分页
 private void Bind()
        {
            this.dgInfo.DataSource=IOrg.GetList(this.drpList.SelectedItem.Value,this.txtSearch.Text):IOrg.GetSingleList(Session["org_o_id"].ToString());
            try
            {
                this.dgInfo.DataBind();
            }
            catch
            {
                this.dgInfo.CurrentPageIndex=0;
                this.dgInfo.DataBind();
            }
        }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2021-05-27
猜你喜欢
  • 2021-05-18
  • 2021-12-03
  • 2021-12-29
  • 2021-07-16
  • 2022-12-23
  • 2021-11-22
  • 2021-09-22
相关资源
相似解决方案