private void Edit(int EditID) { ClearProfilepropertyForm(); ProfileManagementController objController = new ProfileManagementController(); ProfileManagementInfo objinfo = objController.GetProfileByProfileID(EditID); if (objinfo != null) { txtCaption.Text = objinfo.Name; ddlPropertyType.SelectedIndex = ddlPropertyType.Items.IndexOf(ddlPropertyType.Items.FindByValue(objinfo.PropertyTypeID.ToString())); chkIsRequred.Checked = bool.Parse(objinfo.IsRequired.ToString()); ddlDataType.SelectedIndex = ddlDataType.Items.IndexOf(ddlDataType.Items.FindByValue(objinfo.DataType)); if (objinfo.PropertyTypeID != 1 && objinfo.PropertyTypeID != 5 && objinfo.PropertyTypeID != 6 && objinfo.PropertyTypeID != 7 && objinfo.PropertyTypeID != 8 && Session[SessionKeys.PropertyValueDataTable] != null) { List<ProfileManagementInfo> dtActual = objController.GetActiveProfileValueByProfileID(EditID, GetPortalID); CommonFunction LToDCon = new CommonFunction(); if (dtActual != null && dtActual.Count > 0) { DataTable dt = (DataTable)Session[SessionKeys.PropertyValueDataTable]; for (int i = 0; i < dtActual.Count; i++) { DataRow newrow1 = dt.NewRow(); dt.Rows.Add(newrow1); dt.Rows[dt.Rows.Count - 1]["ProfileValueID"] = dtActual[i].ProfileValueID.ToString(); dt.Rows[dt.Rows.Count - 1]["Name"] = dtActual[i].Name; dt.AcceptChanges(); } lstvPropertyValue.DataSource = dt; lstvPropertyValue.DataTextField = "Name"; lstvPropertyValue.DataValueField = "ProfileValueID"; lstvPropertyValue.DataBind(); trListPropertyValue.Style.Add("display", ""); } } else { lstvPropertyValue.DataSource = null; lstvPropertyValue.DataBind(); trListPropertyValue.Style.Add("display", "none"); } } HideAll(); divForm.Style.Add("display", "block"); Session[SessionKeys.EditProfileID] = EditID; }