public void FillGrid() { try { DataTable dt_ = new DataTable(); dt_ = tbl_mjvManager.GetCPVList(); GVScrhCPV.DataSource = dt_; GVScrhCPV.DataBind(); ViewState["MCPV"] = dt_; } catch (Exception ex) { //throw; ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true); lblalert.Text = ex.Message; } }
protected void TBSrhCPV_TextChanged(object sender, EventArgs e) { try { FillGrid(); DataTable _dt = (DataTable)ViewState["MCPV"]; DataView dv = new DataView(_dt, "mjv_sono LIKE '%" + TBSrhCPV.Text.Trim().ToUpper() + "%'", "[mjv_sono] ASC", DataViewRowState.CurrentRows); DataTable dt_ = new DataTable(); dt_ = dv.ToTable(); GVScrhCPV.DataSource = dt_; GVScrhCPV.DataBind(); ViewState["MCPV"] = dt_; } catch (Exception ex) { // throw; ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true); lblalert.Text = ex.Message; } }