Exemple #1
0
        private void GVEmp_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            Status = GVEmp.GetRowCellValue(e.RowHandle, "Description").ToString();
            Name   = GVEmp.GetRowCellValue(e.RowHandle, "Name").ToString();

            StatusCmb.Text = Status;
            NameTxt.Text   = Name;

            NameTxt.Enabled = true;
            saveBtn.Enabled = true;
        }
        public void FillGrid()
        {
            try
            {
                dt_ = new DataTable();
                dt_ = DBConnection.GetQueryData("   select * from users  where CompanyId = '" + Session["CompanyID"] + "' and BranchId= '" + Session["BranchID"] + "'");

                GVEmp.DataSource = dt_;
                GVEmp.DataBind();
                ViewState["Emp"] = dt_;
            }
            catch (Exception ex)
            {
                //throw;
                ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true);
                lblalert.Text = ex.Message;
            }
        }
 protected void TBSearch_TextChanged(object sender, EventArgs e)
 {
     System.Threading.Thread.Sleep(2000);
     try
     {
         FillGrid();
         DataTable _dt = (DataTable)ViewState["Emp"];
         DataView  dv  = new DataView(_dt, "Username LIKE '%" + TBSearch.Text.Trim().ToUpper() + "%'", "[Username] ASC", DataViewRowState.CurrentRows);
         DataTable dt_ = new DataTable();
         dt_ = dv.ToTable();
         GVEmp.DataSource = dt_;
         GVEmp.DataBind();
         TBSearch.Text = "";
     }
     catch (Exception ex)
     {
         //   throw;
         ScriptManager.RegisterStartupScript(this, this.GetType(), "isActive", "Alert();", true);
         lblalert.Text = ex.Message;
     }
 }