protected void grdBrands_ItemCommand(object source, DataGridCommandEventArgs e) { string strCA = e.CommandArgument.ToString(); switch (e.CommandName) { case "Edit": Insert = false; Id = strCA; List <ApartmentInfo> listApartmentInfos = ApartmentService.ApartmentInfo_GetById(Id); //txtName.Text = listE[0].Name; //txtLogo.Text = listE[0].Logo; //imgLogo.ImageUrl = listE[0].Logo.Length > 0 ? listE[0].Logo : ""; //txtOrd.Text = listE[0].Ord; pnView.Visible = false; pnUpdate.Visible = true; break; case "Delete": ApartmentService.ApartmentInfo_Delete(strCA); BindGrid(); break; } }