public void FillBRANCH_RECMAS_MasterGrid(string CompCode) { DataTable Dt = new DataTable(); Dt = BRANCH_RECMASLogicLayer.GetAllBRANCH_REC_MASDetails(Convert.ToInt32(Session["USERCODE"].ToString()), Convert.ToInt32(Session["COMP_CODE"].ToString())); DataView Dv = new DataView(Dt); if (CompCode != string.Empty) { Dv.RowFilter = "COMP_CODE=" + Session["COMP_CODE"].ToString(); } GvBranchReceivedMaster.DataSource = Dv.ToTable(); GvBranchReceivedMaster.DataBind(); DtSearch = Dv.ToTable(); }
protected void TxtSearch_TextChanged(object sender, EventArgs e) { try { if (TxtSearch.Text != string.Empty) { DataView Dv = new DataView(DtSearch); Dv.RowFilter = "CHA_NO like '%" + TxtSearch.Text.Trim() + "%' OR FromBranchName like '%" + TxtSearch.Text.Trim() + "%' OR ToBranchName like '%" + TxtSearch.Text.Trim() + "%' OR Convert(SERIALNO, 'System.String') like '%" + TxtSearch.Text.Trim() + "%'"; GvBranchReceivedMaster.DataSource = Dv.ToTable(); GvBranchReceivedMaster.DataBind(); } else { GvBranchReceivedMaster.DataSource = DtSearch; GvBranchReceivedMaster.DataBind(); } } catch (Exception) { throw; } }