コード例 #1
0
        private void FillGrid()
        {
            DataTable dt = new DataTable();

            dt = new BALCountryMaster().Select(new BOLCountryMaster());
            gvCountry.DataSource = dt;
            gvCountry.DataBind();
        }
コード例 #2
0
        protected void lnkbtnEdit_Click(object sender, EventArgs e)
        {
            LinkButton  btnEdit = sender as LinkButton;
            GridViewRow gr      = (GridViewRow)btnEdit.NamingContainer;
            Label       lblId1  = (Label)gvCountry.Rows[gr.RowIndex].FindControl("lblId");
            DataTable   dt      = new BALCountryMaster().Select(new BOLCountryMaster()
            {
                Id = int.Parse(lblId1.Text)
            });

            if (dt.Rows.Count > 0)
            {
                lblId.Text      = lblId1.Text;
                txtCountry.Text = dt.Rows[0]["Country"].ToString();
            }
            pnlData.Visible = true;
            pnlGrid.Visible = false;
            btnSubmit.Text  = "Update";
            txtCountry.Focus();
        }