コード例 #1
0
        void PreferenceAdd_ControlCancelled(object sender)
        {
            PreferenceEdit1.Clear();

            btnAddNewPreference.Visible = true;
            pnlGrids.Visible            = true;
            divEdit.Visible             = false;
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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();
            }
        }