void PreferenceAdd_ControlCancelled(object sender) { PreferenceEdit1.Clear(); btnAddNewPreference.Visible = true; pnlGrids.Visible = true; divEdit.Visible = false; }
void PreferenceAdd_ControlSaved(object sender, ControlSavedEventArgs e) { PreferenceEdit1.Clear(); BindGrids(); btnAddNewPreference.Visible = true; pnlGrids.Visible = true; divEdit.Visible = false; lblFeedback.Text = string.Format("Preference saved: {0}", DateTime.Now); }
void gvwPrefs_SelectedIndexChanged(object sender, EventArgs e) { GridView gvw = (GridView)sender; int prefId = int.Parse(gvw.SelectedDataKey.Value.ToString()); PreferenceEdit1.PrimaryKeyIndex = prefId; PreferenceEdit1.Bind(); btnAddNewPreference.Visible = false; pnlGrids.Visible = false; divEdit.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { int prefId = 0; if (Request.QueryString.AllKeys.Contains("PreferenceID")) { prefId = int.Parse(Request.QueryString["PreferenceID"]); } if (prefId != 0) { PreferenceEdit1.PrimaryKeyIndex = prefId; PreferenceEdit1.Bind(); btnAddNewPreference.Visible = false; pnlGrids.Visible = false; divEdit.Visible = true; } else if (!IsPostBack) { //BindGrids(); } }