コード例 #1
0
        public ActionResult ModalPartial(string DialogID, string TagIDOfReturnedID, string TagIDOfReturnedLabel, string DialogType, string ContentReference)
        {
            if (DialogType == "ModalDataGrid")
            {
                ModalDialog md = new ModalDialog(DialogID + "-D", "en", "Test title");
                md.TagIDOfReturnedID    = TagIDOfReturnedID;
                md.TagIDOfReturnedLabel = TagIDOfReturnedLabel;
                md.ModalDialogID        = DialogID;
                md.Fields = GetFieldsFromDB(ContentReference);
                return(PartialView("NewPartial", md));
            }
            else
            {
                ModalDialog   md = new ModalDialog(DialogID + "-D", "en", "Test title");
                DataGridField d  = new DataGridField("DGtest", null);
                d.SetHeaderLabels("Jmeno", "Prijmeni", "Aktivni");

                TableRow tr = new TableRow();
                tr.AddColumnCell(new LabelField("Jmeno"));
                tr.AddColumnCell(new LabelField("Prijmeni"));
                //tr.AddColumnCell(new CheckBoxField("", "", true, new WebTagAttributes(true, "")));
                tr.AddColumnCell(new CheckBoxField("", "", "", false, false));

                //d.AddDataRow(tr, 1);
                //d.AddDataRow(tr.MakeCopy());
                //d.AddDataRow(tr.MakeCopy());

                md.AddField(d);
                md.TagIDOfReturnedID    = TagIDOfReturnedID;
                md.TagIDOfReturnedLabel = TagIDOfReturnedLabel;
                md.ModalDialogID        = DialogID;

                //md.ReturnLabelFieldID = ReturnLabelFieldID;
                //md.AddField(new LabelTextBoxField("testTextBoxDield", "Label", "already in"));
                return(PartialView("ModalPartial", md));
            }
        }