protected void dgAccomodations_SelectedIndexChanged(object sender, EventArgs e) { //DateTime dt; int iAccomID = Convert.ToInt32(dgAccomodations.DataKeys[dgAccomodations.SelectedIndex]); Session["accomid"] = iAccomID; hfId.Value = iAccomID.ToString(); txtAccomName.Text = dgAccomodations.SelectedItem.Cells[1].Text.ToString().Trim(); ddlAccomTypeId.SelectedValue = Convert.ToString(dgAccomodations.SelectedItem.Cells[2].Text).Trim(); ddlRegion.SelectedValue = Convert.ToString(dgAccomodations.SelectedItem.Cells[4].Text).Trim(); txtAccomInitial.Text = Convert.ToString(dgAccomodations.SelectedItem.Cells[6].Text).Trim(); txtAccomPolicyUrl.Text = Convert.ToString(dgAccomodations.SelectedItem.Cells[7].Text).Trim(); btnInactive.Visible = true; bal.accomId = iAccomID; DataTable dt = dal.getdetailsbyaccomid(bal); if (dt != null && dt.Rows.Count > 0) { if (dt.Rows[0]["ActiveStatus"].ToString() == "") { btnInactive.Text = "Inactive"; } if (dt.Rows[0]["ActiveStatus"].ToString() == "True") { btnInactive.Text = "Active"; } } //dt = DateTime.MinValue; //DateTime.TryParse(dgAccomodations.SelectedItem.Cells[7].Text, out dt); //txtSeasonStartDate.Text = dt != DateTime.MinValue ? GF.Handle19000101(dt, false) : ""; //dt = DateTime.MinValue; //DateTime.TryParse(dgAccomodations.SelectedItem.Cells[8].Text, out dt); //txtSeasonEndDate.Text = dt != DateTime.MinValue ? GF.Handle19000101(dt, false) : ""; //btnAddNew.Enabled = false; //btnCancel.Enabled = true; btnCancel.Visible = true; btnDelete.Enabled = true; btnEdit.Text = "Update"; //btnEdit.Enabled = true; //btnSave.Enabled = false; lblStatus.Text = ""; }