示例#1
0
 protected void ctlAddNew_Click(object sender, ImageClickEventArgs e)
 {
     ctlLanguageModalPopupExtender.Show();
     ctlLanguageGrid.DataCountAndBind();
     ctlLanguageForm.ChangeMode(FormViewMode.Insert);
     UpdatePanelLanguageForm.Update();
 }
示例#2
0
        protected void ctlLanguageGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UserEdit")
            {
                int   rowIndex   = ((GridViewRow)((ImageButton)e.CommandSource).NamingContainer).RowIndex;
                short languageId = UIHelper.ParseShort(ctlLanguageGrid.DataKeys[rowIndex].Value.ToString());
                ctlLanguageGrid.EditIndex = rowIndex;

                IList <DbLanguage> languageList = new List <DbLanguage>();
                DbLanguage         language     = DbLanguageService.FindProxyByIdentity(languageId);
                languageList.Add(language);

                ctlLanguageForm.DataSource = languageList;
                ctlLanguageForm.ChangeMode(FormViewMode.Edit);
                ctlLanguageGrid.DataCountAndBind();

                UpdatePanelLanguageForm.Update();
                ctlLanguageForm.DataBind();
                ctlLanguageModalPopupExtender.Show();
            }
        }