private ASPxPanel editorSetup() { ASPxPanel editorPanel = new ASPxPanel(); editorPanel.Width = Unit.Percentage(100); ASPxHtmlEditor htmlPanel = new ASPxHtmlEditor(); htmlPanel.ID = "htmlPanel"; htmlPanel.Height = Unit.Pixel(250); htmlPanel.Width = Unit.Percentage(100); htmlPanel.Html = "<div style=\"font-size: 11px;\"></div>"; string appDir = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath; string appUrl = HttpContext.Current.Request.Url.Host; string imgDir = string.Format("{0}\\{1}", appDir, "Images\\editors"); if (!System.IO.Directory.Exists(imgDir)) { System.IO.Directory.CreateDirectory(imgDir); } if (System.IO.Directory.Exists(imgDir)) { htmlPanel.SettingsDialogs.InsertImageDialog.SettingsImageUpload.UploadFolder = "/Images/editors/"; //"./Images/editors"; // imgDir; // UploadImageFolder } htmlPanel.HtmlChanged += new EventHandler <EventArgs>(htmlPanel_HtmlChanged); editorPanel.Controls.Add(htmlPanel); return(editorPanel); }
public override System.Web.UI.Control Build() { base.Build(); ASPxDropDownEdit ddedit = new ASPxDropDownEdit(); ASPxHiddenField hfddedit = new ASPxHiddenField(); ASPxPanel panel = new ASPxPanel(); ddedit.Width = ModuleField.Width; ddedit.Height = ModuleField.Height; ddedit.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired; ddedit.ValidationSettings.RequiredField.ErrorText = ModuleField.ErrorText; ddedit.ReadOnly = true; ddedit.Text = ModuleField.CurrentValue == null ? ModuleField.DefaultValue == null ? null : ModuleField.DefaultValue.ToString() : ModuleField.CurrentValue.ToString(); ddedit.ClientInstanceName = "dropdown"; ddedit.DropDownWindowTemplate = new MyTemplate(ModuleField.CodeCat, hfddedit); ddedit.ClientSideEvents.TextChanged = "SynchronizeListBoxValues"; ddedit.ClientSideEvents.DropDown = "SynchronizeListBoxValues"; //ddedit.Enabled 可用来做只读 //hf hfddedit.ClientInstanceName = "hfddedit"; hfddedit.Clear(); if (ModuleField.CurrentCode != null) { List <string> codelist = ModuleField.CurrentCode.ToString().Split(';').ToList(); foreach (string code in codelist) { hfddedit.Add(code, ""); } } panel.Controls.Add(ddedit); panel.Controls.Add(hfddedit); return(panel); }
public HintPanelBase() { Paddings.PaddingBottom = 8; var innerHintPanel = new ASPxPanel(); Controls.Add(innerHintPanel); label = new ASPxLabel { EncodeHtml = false }; innerHintPanel.Controls.Add(label); }
/// <summary> /// 用一个foreach的函数填入相关信息 /// </summary> /// <returns></returns> public override System.Web.UI.Control Build() { base.Build(); ASPxPanel panel = new ASPxPanel(); ASPxCheckBox checkbox; ASPxHiddenField CBhiddenfield = new ASPxHiddenField(); ASPxHiddenField CBhiddenfieldc = new ASPxHiddenField(); ASPxHiddenField CBhiddenfieldall = new ASPxHiddenField(); CBhiddenfield.ClientInstanceName = "CBhiddenfield"; CBhiddenfield.Clear(); CBhiddenfieldc.ClientInstanceName = "CBhiddenfieldc"; CBhiddenfieldc.Clear(); CBhiddenfieldall.ClientInstanceName = "CBhiddenfieldall"; CBhiddenfieldall.Clear(); //先添加隐藏控件 panel.Controls.Add(CBhiddenfield); panel.Controls.Add(CBhiddenfieldc); panel.Controls.Add(CBhiddenfieldall); string selected = ModuleField.CurrentValue == null ? ModuleField.DefaultValue == null ? null : ModuleField.DefaultValue.ToString() : ModuleField.CurrentValue.ToString(); List <string> selectedlist = new List <string>(); if (selected != null) { string[] selectedarray = selected.Split(';'); selectedlist = selectedarray.ToList <string>(); } List <DictionaryItem> itemslist = new List <DictionaryItem>(); using (TestDBEntities entity = new TestDBEntities()) { itemslist = entity.DictionaryItem.Where(oo => oo.DictionaryItemCode.StartsWith(ModuleField.CodeCat) && oo.DictionaryItemCode.Length == 7).ToList(); } foreach (DictionaryItem item in itemslist) { checkbox = new ASPxCheckBox(); checkbox.Text = item.DictionaryItemName; checkbox.Value = item.DictionaryItemValue; CBhiddenfieldall.Add(item.DictionaryItemName, item.DictionaryItemValue); checkbox.ClientSideEvents.CheckedChanged = "function (s,e) {CBchange(s,e);}"; if (selected != null) { foreach (string defaultchecked in selectedlist) { if (item.DictionaryItemName == defaultchecked) { checkbox.Checked = true; CBhiddenfield.Add(item.DictionaryItemName, ""); CBhiddenfield.Add(item.DictionaryItemValue, ""); } } } panel.Controls.Add(checkbox); } //排列方式 return(panel); }
private void renderQuestions() { tblQuestions = getQuestions(); if (validateTicket() > -1) { foreach (DataRow dr in tblQuestions.Rows) { int id = Convert.ToInt32(dr["ID"]); string detail = dr["Detail"].ToString(); string typeInput = dr["TypeInput"].ToString(); int options = Convert.ToInt32(dr["Options"]); ASPxPanel pnlQuestion = new ASPxPanel(); pnlQuestion.ID = "pnl" + id; pnlQuestion.Style["width"] = "100%"; pnlQuestion.Style["margin-bottom"] = "15px"; ASPxLabel lblDetail = new ASPxLabel(); lblDetail.ID = "Q" + id; lblDetail.Text = detail; lblDetail.Style["font-weight"] = "bold"; lblDetail.Style["margin-bottom"] = "15px"; lblDetail.Style["font-size"] = "15px;"; pnlQuestion.Controls.Add(lblDetail); if (typeInput == "TEXT") { ASPxMemo memo = new ASPxMemo(); memo.ID = "memo" + id; memo.Style["width"] = "100%"; memo.Height = 70; pnlQuestion.Controls.Add(memo); } if (typeInput == "RADIOBUTTON") { ASPxRadioButtonList radio = new ASPxRadioButtonList(); radio.ID = "radio" + id; radio.Style["width"] = "100%"; radio.Style["border"] = "none"; for (int i = 1; i <= options; i++) { radio.Items.Add(new ListEditItem(i.ToString(), i)); } radio.RepeatDirection = RepeatDirection.Horizontal; radio.SelectedIndex = 0; pnlQuestion.Controls.Add(radio); } phContent.Controls.Add(pnlQuestion); } } else { lblMsg.Text = "Survey does not exist or has already been registered"; popMsg.ShowOnPageLoad = true; } }
private void editorRender(ref ASPxPanel editorPanel) { ASPxHtmlEditor htmlPanel = (ASPxHtmlEditor)(editorPanel.FindControl("htmlPanel")); if (htmlPanel != null) { htmlPanel.Html = txtHTML; } }
private void editorRender(ref ASPxPanel editorPanel) { ASPxTrackBar trackbarPanel = (ASPxTrackBar)(editorPanel.FindControl("trackbarPanel")); if (trackbarPanel != null) { trackbarPanel.Value = tbValue; } }
protected override void ReadEditModeValueCore() { if (PropertyValue != null) { txtHTML = (string)PropertyValue; } ASPxPanel editorPanel = (ASPxPanel)Editor; editorRender(ref editorPanel); }
protected override void ReadEditModeValueCore() { if (PropertyValue != null) { tbValue = (Int32)PropertyValue; } ASPxPanel editorPanel = (ASPxPanel)Editor; editorRender(ref editorPanel); }
//Return the control's current value //protected override object GetControlValue() //{ // return fileuploads; //} protected override void ReadEditModeValueCore() { if (PropertyValue != null) { fileuploads = (FileUploads)PropertyValue; } ASPxPanel upPanel = (ASPxPanel)Editor; //editorRender(ref upPanel); }
//Return the control's current value //protected override object GetControlValue() //{ // return fileuploads; //} protected override void ReadEditModeValueCore() { if (CurrentObject != null) { fileuploads = CurrentObject as FileUploads; } ASPxPanel upPanel = (ASPxPanel)Editor; //editorRender(ref upPanel); }
public FilterPanel() { Paddings.PaddingBottom = 8; var innerHintPanel = new ASPxPanel(); innerHintPanel.Paddings.Assign(new Paddings(8, 8, 8, 8)); innerHintPanel.BackColor = System.Drawing.Color.LightGoldenrodYellow; Controls.Add(innerHintPanel); label = new ASPxLabel(); innerHintPanel.Controls.Add(label); }
protected void AddPivot(ASPxPanel panel, DataTable dtvars, int mymeasureid, Datadictionary dict) { ASPxPivotGrid pivot = new ASPxPivotGrid(); pivot.ID = mymeasureid.ToString(); pivot.DataSource = dtvars; pivot.DataBind(); pivot.RetrieveFields(); pivot.OptionsPager.RowsPerPage = 50; pivot.OptionsCustomization.AllowExpand = false; pivot.Fields["varnum"].Area = PivotArea.RowArea; pivot.Fields["variablelabel"].Area = PivotArea.RowArea; pivot.Fields["varnum"].AreaIndex = 0; pivot.Fields["variablelabel"].AreaIndex = 1; //pivot.Fields["ord_pos"].Visible = false; pivot.Fields["timepoint_text"].Area = PivotArea.ColumnArea; pivot.Fields["timepoint_text"].AreaIndex = 0; if (mymeasureid == 4911 | mymeasureid == 4912) { pivot.Fields["studymeasname2"].Area = PivotArea.ColumnArea; pivot.Fields["studymeasname2"].AreaIndex = 1; } pivot.Fields["value"].Area = PivotArea.DataArea; pivot.Fields["value"].SummaryType = DevExpress.Data.PivotGrid.PivotSummaryType.Min; pivot.Fields["timepoint_text"].TotalsVisibility = PivotTotalsVisibility.None; pivot.Fields["varnum"].TotalsVisibility = PivotTotalsVisibility.None; pivot.Fields["id"].TotalsVisibility = PivotTotalsVisibility.None; pivot.Fields["value"].TotalsVisibility = PivotTotalsVisibility.None; pivot.OptionsView.ShowColumnGrandTotals = false; pivot.OptionsView.ShowRowGrandTotals = false; pivot.OptionsView.ShowColumnHeaders = false; pivot.OptionsView.ShowRowHeaders = false; pivot.OptionsView.ShowDataHeaders = false; pivot.OptionsView.ShowFilterHeaders = false; ASPxLabel lbl = new ASPxLabel(); lbl.EncodeHtml = false; lbl.Text = String.Format("<br/><b>{0}</b>", dict.measname); lbl.Font.Size = 14; panel.Controls.Add(lbl); panel.Controls.Add(pivot); }
private void viewRender(ref ASPxPanel viewPanel) { ASPxLabel lblInfo = new ASPxLabel(); if (PropertyValue != null) // && View != null { lblInfo.Text = (string)PropertyValue;; lblInfo.EncodeHtml = false; } viewPanel.Controls.Add(lblInfo); }
// 初始加载treelist public System.Web.UI.Control LoadTreeList(string target) { ASPxPanel panel = new ASPxPanel(); string _targetTable = GetTargetTableName((int)ModuleField.FieldType); StringBuilder sql = new StringBuilder(); if (target == "Dictionary") { sql.Append("select * from DictionaryItem where 1=1"); sql.Append(" and DictionaryItemCode like '" + ModuleField.CodeCat + "%'"); } else { sql.Append("select * from " + _targetTable + " where 1=1"); } DataSet userset = SqlHelper.GetDataBySQL(sql.ToString(), _targetTable); List <ExtendCode> extdlist = new List <ExtendCode>(); for (int i = 0; i < userset.Tables[0].Rows.Count; i++) { DataRow dr = userset.Tables[0].Rows[i]; ExtendCode extcode = new ExtendCode(); extcode.ExtendCodeID = Convert.ToInt32(dr.ItemArray[0].ToString()); extcode.ExtendCodeCode = dr.ItemArray[1].ToString(); extcode.ExtendCodeName = dr.ItemArray[2].ToString(); extcode.ParentID = Convert.ToInt32(dr.ItemArray[5].ToString()); extdlist.Add(extcode); } ASPxTreeList treelist = new ASPxTreeList(); treelist.ClientInstanceName = "treelist" + ModuleField.FieldID; treelist.KeyFieldName = "ExtendCodeID"; treelist.ParentFieldName = "ParentID"; treelist.SettingsSelection.Enabled = true; treelist.SettingsSelection.Recursive = true; treelist.SettingsSelection.AllowSelectAll = true; treelist.CustomDataCallback += new TreeListCustomDataCallbackEventHandler(treeList_CustomDataCallback); //treelist.GetSelectedNodes(); treelist.ClientSideEvents.CustomDataCallback = "function(s, e) { CustomDataCallbackComplete(e," + ModuleField.FieldID + ");}"; TreeListDataColumn datacol = new TreeListDataColumn(); datacol.FieldName = "ExtendCodeName"; datacol.VisibleIndex = 0; treelist.SettingsBehavior.ExpandCollapseAction = TreeListExpandCollapseAction.NodeDblClick; treelist.Columns.Add(datacol); panel.Controls.Add(treelist); treelist.DataSource = extdlist; treelist.DataBound += new EventHandler(treeList_DataBound);//treelist.DataBind(); return(panel); }
public override System.Web.UI.Control Build() { base.Build(); ASPxPanel panel = new ASPxPanel(); ASPxUploadControl uploadfile = new ASPxUploadControl(); ASPxButton uploadfilebutton = new ASPxButton(); ASPxLabel uploadfileurl = new ASPxLabel(); ASPxButton uploadfiledelete = new ASPxButton(); ASPxCallback callbackfiledelete = new ASPxCallback(); //定义上传框体 uploadfile.BrowseButton.Text = "浏览"; uploadfile.ClientInstanceName = "uploadfile"; uploadfile.FileUploadComplete += new EventHandler <FileUploadCompleteEventArgs>(FileUploadComplete); //uploadfile.ClientSideEvents.FilesUploadComplete = "function(s, e) { Uploader_PicturesUploadComplete(e); }"; uploadfile.ClientSideEvents.FileUploadComplete = "function(s, e) { Uploader_FileUploadComplete(e); }"; uploadfile.ClientSideEvents.FileUploadStart = "function(s, e) { Uploader_FileUploadStart(); }"; uploadfile.ClientSideEvents.TextChanged = "function(s, e) { FileUpdateUploadButton(); }"; //uploadfile.ValidationSettings.MaxFileSize = 4194304; //string[] fileExtensions = new string[4] { ".jpg", ".jpeg", ".jpe", ".gif" }; //uploadfile.ValidationSettings.AllowedFileExtensions = fileExtensions; //定义上传文件按钮 uploadfilebutton.AutoPostBack = false; uploadfilebutton.Text = "上传"; uploadfilebutton.ClientEnabled = false; uploadfilebutton.ClientInstanceName = "uploadfilebutton"; uploadfilebutton.ClientSideEvents.Click = "function(s, e) { uploadfiledeletefunc();uploadfile.Upload();}"; //定义上传后文件名显示 uploadfileurl.Text = "文件名:"; uploadfileurl.ClientInstanceName = "uploadfileurl"; //定义删除文件按钮 uploadfiledelete.Text = "删除"; uploadfiledelete.ClientInstanceName = "uploadfiledelete"; uploadfiledelete.ClientEnabled = false; uploadfiledelete.ClientSideEvents.Click = "function(s, e) { uploadfiledeletefunc(); }"; //callback回传服务器删除文件 callbackfiledelete.ClientInstanceName = "callbackdeletefile"; callbackfiledelete.Callback += new CallbackEventHandler(OnCallbackDeleteFile); panel.Controls.Add(new LiteralControl("<table><tr><td>")); panel.Controls.Add(uploadfile); panel.Controls.Add(new LiteralControl("</td><td>")); panel.Controls.Add(uploadfilebutton); panel.Controls.Add(new LiteralControl("</td></tr><tr><td>")); panel.Controls.Add(uploadfileurl); panel.Controls.Add(new LiteralControl("</td><td>")); panel.Controls.Add(uploadfiledelete); panel.Controls.Add(new LiteralControl("</td></tr></table>")); panel.Controls.Add(callbackfiledelete); return(panel); }
public HintPanel() { hintPanel = new ASPxPanel(); hintPanel.Style[HtmlTextWriterStyle.MarginBottom] = Unit.Pixel(8).ToString(); hintPanel.Paddings.Assign(new Paddings(8, 8, 8, 8)); hintPanel.BackColor = Color.LightGoldenrodYellow; hintPanel.ClientVisible = false; hintLabel = new ASPxLabel(); hintPanel.Controls.Add(hintLabel); Controls.Add(hintPanel); }
protected override void ReadViewModeValueCore() { base.ReadViewModeValueCore(); if (CurrentObject != null) { ASPxPanel viewPanel = (ASPxPanel)InplaceViewModeEditor; if (viewPanel.Controls.Count == 0) { viewRender(ref viewPanel); } //this.CreateControl(); } }
/*protected override IHttpRequestManager CreateHttpRequestManager() { * //return new Full.XCRM.Web.MyHttpRequestManager(); * }*/ private void XCRMWebApplication_CustomizeTemplate(object sender, CustomizeTemplateEventArgs e) { Page page = e.Template as Page; if (page != null) { ASPxPanel container = page.FindControl("NC") as ASPxPanel; if (container != null) { container.Width = Unit.Pixel(245); } } }
protected void pnlNavBar_Init(object sender, EventArgs e) { ASPxPanel panel = sender as ASPxPanel; // ASPxNavBar should be created at the first time, and on its callbacks if ((hf.Contains("all") && Convert.ToBoolean(hf.Get("all"))) || !Page.IsCallback || Request.Params["__CALLBACKID"].Contains(panel.ID)) { Control ctrl = LoadControl("~/navbar.ascx"); ctrl.ID = "navbar"; panel.Controls.Clear(); panel.Controls.Add(ctrl); } }
protected void uploadPanel_FileUploadComplete(object sender, FileUploadCompleteEventArgs e) { if (e.IsValid) { e.CallbackData = SaveFile(e.UploadedFile); CurrentObject = fileuploads; fileuploads.Session.CommitTransaction(); isUploadComplete = true; ASPxPanel upPanel = (ASPxPanel)Editor; editorRender(ref upPanel); //this.UpdateEditorState(); this.Refresh(); } }
public override System.Web.UI.Control Build() { base.Build(); ASPxPanel panel = new ASPxPanel(); ASPxRadioButtonList radioList = new ASPxRadioButtonList(); radioList.ClientInstanceName = "radioList"; //是否必填 radioList.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired; //选项为空的提示 radioList.ValidationSettings.RequiredField.ErrorText = ModuleField.ErrorText; //排列方式 radioList.RepeatDirection = RepeatDirection.Horizontal; //代码分类 List <DictionaryItem> itemslist = new List <DictionaryItem>(); using (TestDBEntities entity = new TestDBEntities()) { itemslist = entity.DictionaryItem.Where(oo => oo.DictionaryItemCode.StartsWith(ModuleField.CodeCat) && oo.DictionaryItemCode.Length == 7).ToList(); } foreach (DictionaryItem item in itemslist) { radioList.Items.Add(item.DictionaryItemName, item.DictionaryItemValue); } //默认值与当前值 string selected = ModuleField.CurrentValue == null ? ModuleField.DefaultValue == null ? null : ModuleField.DefaultValue.ToString() : ModuleField.CurrentValue.ToString(); if (selected != null) { radioList.Items.FindByText(selected).Selected = true; } //为RBlist添加改变事件 radioList.ClientSideEvents.SelectedIndexChanged = "function (s,e){RBchange(s);}"; //添加一个隐藏控件 ASPxHiddenField RBhiddenfield = new ASPxHiddenField(); RBhiddenfield.ClientInstanceName = "RBhiddenfield"; RBhiddenfield.Clear(); //写入值 if (selected != null) { RBhiddenfield.Add(radioList.Items.FindByText(selected).Text, radioList.Items.FindByText(selected).Value); } panel.Controls.Add(radioList); panel.Controls.Add(RBhiddenfield); return(panel); }
private ASPxPanel editorSetup() { ASPxPanel editorPanel = new ASPxPanel(); editorPanel.Width = Unit.Percentage(100); ASPxUploadControl upPanel = new ASPxUploadControl(); upPanel.ID = "upPanel"; upPanel.FileUploadMode = UploadControlFileUploadMode.OnPageLoad; upPanel.ViewStateMode = System.Web.UI.ViewStateMode.Enabled; upPanel.UploadMode = UploadControlUploadMode.Auto; //Standard //upPanel.AddUploadButtonsHorizontalPosition = AddUploadButtonsHorizontalPosition.InputRightSide; upPanel.ShowProgressPanel = true; //upPanel.ShowAddRemoveButtons = true; upPanel.ProgressBarSettings.DisplayMode = DevExpress.Web.ProgressBarDisplayMode.Percentage; upPanel.ValidationSettings.AllowedFileExtensions = new string[] { ".jpg", ".png", ".psd", ".pdf", ".gif", ".docx", ".doc", ".xls", ".xlsx", ".txt", ".zip", ".rar", ".fla", ".swf" }; upPanel.ShowUploadButton = true; upPanel.UploadButton.Image.Url = "Images/upload.png"; upPanel.UploadButton.Image.UrlDisabled = "Images/upload_disable.png"; upPanel.UploadButton.ImagePosition = DevExpress.Web.ImagePosition.Left; if (PropertyValue != null && PropertyValue.GetType() == typeof(FileUploads)) { fileuploads = (FileUploads)PropertyValue; } upPanel.NullText = fileuploads == null ? "Click để chọn file upload.." : string.Format("{0}", fileuploads.Name); //upPanel.NullText = string.Format("File hiện tại: {0}", fileuploads == null ? "N/A" : fileuploads.Name); //Cho phep chon & upload nhieu file upPanel.AdvancedModeSettings.EnableMultiSelect = false; upPanel.FileUploadComplete += new EventHandler <FileUploadCompleteEventArgs>(uploadPanel_FileUploadComplete); //upPanel.PreRender //upPanel.CustomJSProperties ASPxLabel label = new ASPxLabel(); ASPxLabel lblNote = new ASPxLabel(); lblNote.Text = "Các bước UPLOAD file: \n1.Bấm 'Browse..' để chọn file.\n2. Bấm 'Upload' để tải file lên.\n3. Bấm 'Lưu' để xác nhận, file sẽ được lưu lên máy chủ."; lblNote.ForeColor = System.Drawing.Color.Gray; lblNote.BackColor = System.Drawing.Color.FromArgb(0xF2, 0xF2, 0xF2); label.ID = "upLabelPanel"; editorPanel.Controls.Add(label); editorPanel.Controls.Add(upPanel); editorPanel.Controls.Add(lblNote); return(editorPanel); }
protected WebControl CreateBottomPanel() { trackBar = CreateTrackBar(); statusLabel = CreateStatuLabel(); this.UpdateLabelText(); this.UpdateLabelStyle(); ASPxPanel trackBarPanel = new ASPxPanel(); trackBarPanel.Width = Unit.Percentage(100); trackBarPanel.Controls.Add(this.CreateTrackbarLabel()); trackBarPanel.Controls.Add(trackBar); if (!IsCurrentCanUpdate) { trackBar.Enabled = false; } return(trackBarPanel); }
public override System.Web.UI.Control Build() { base.Build(); ASPxPanel panel = new ASPxPanel(); ASPxUploadControl MUploadControl = new ASPxUploadControl(); ASPxRoundPanel MUploadRoundPanel = new ASPxRoundPanel(); PanelContent MUploadPanelContent = new PanelContent(); //对上传控件的定义 MUploadControl.ShowAddRemoveButtons = true; MUploadControl.BrowseButton.Text = "浏览"; MUploadControl.UploadButton.Text = "上传"; MUploadControl.AddButton.Text = "添加"; MUploadControl.RemoveButton.Text = "移除"; MUploadControl.Width = 300; MUploadControl.ShowUploadButton = true; MUploadControl.AddUploadButtonsHorizontalPosition = AddUploadButtonsHorizontalPosition.Left; MUploadControl.ShowProgressPanel = true; MUploadControl.ClientInstanceName = "MUploadControl"; MUploadControl.FileUploadComplete += new EventHandler <FileUploadCompleteEventArgs>(FilesUploadComplete); MUploadControl.FileInputCount = 3; //MUploadControl.ValidationSettings.MaxFileSize = 4194304; //string[] fileExtensions = new string[4] { ".jpg", ".jpeg", ".jpe", ".gif" }; //MUploadControl.ValidationSettings.AllowedFileExtensions = fileExtensions; MUploadControl.ClientSideEvents.FileUploadComplete = "function(s, e) { FilesUploaded(s, e) }"; MUploadControl.ClientSideEvents.FileUploadStart = "function(s, e) { FilesUploadStart(); }"; //对上传显示的定义 MUploadRoundPanel.Width = 300; MUploadRoundPanel.ClientInstanceName = "MUploadRoundPanel"; MUploadRoundPanel.HeaderText = "上传文件列表"; //RoundPanel内部插件 MUploadPanelContent.Controls.Add(new LiteralControl("<div id='uploadedListFiles' style='height: 150px; font-family: Arial;'></div>")); MUploadRoundPanel.Controls.Add(MUploadPanelContent); //MUploadRoundPanel.Height = 100%; //构建panel panel.Controls.Add(new LiteralControl("<table><tr><td>")); panel.Controls.Add(MUploadControl); panel.Controls.Add(new LiteralControl("</td><td>")); panel.Controls.Add(MUploadRoundPanel); panel.Controls.Add(new LiteralControl("</td></tr></table>")); return(panel); }
private void editorRender(ref ASPxPanel editorPanel) { ASPxUploadControl upPanel = (ASPxUploadControl)(editorPanel.FindControl("upPanel")); ASPxLabel label = (ASPxLabel)(editorPanel.FindControl("upLabelPanel")); if (upPanel != null) { upPanel.NullText = fileuploads == null ? "Click để chọn file từ PC.." : string.Format("{0}", fileuploads.FileName); } if (label != null && CurrentObject != null && isUploadComplete) { label.Text = string.Format("File '{0}' đã upload thành công!", ((FileUploads)CurrentObject).FileName); label.ForeColor = System.Drawing.Color.FromArgb(0x33, 0x66, 0x00); label.Visible = true; this.Refresh(); } }
// 根据code值,循环加载导航条;另外一种处理方式就是:在前台用js动态修改导航条(并不是每中修改都需要前后台的交互) public System.Web.UI.Control LoadNav(string code) { ASPxPanel panel = new ASPxPanel(); #region 根据code获取nav的初始值 Dictionary codecat = new Dictionary(); string _catName = string.Empty; using (TestDBEntities entity = new TestDBEntities()) { codecat = entity.Dictionary.Where(pp => pp.DictionaryCode == code).FirstOrDefault(); } _catName = codecat.DictionaryName; string nav = "<div id='dyn_nav'><ul id='nav'><li>"; nav += "<a onclick=\"navclicked(\'" + code + "\',\'" + _catName + "\',1)\">" + _catName + "</a></li><li>"; panel.Controls.Add(new LiteralControl(nav)); #endregion return(panel); }
public override System.Web.UI.Control Build() { base.Build(); ASPxPanel panel = new ASPxPanel(); ASPxLabel linktextlab = new ASPxLabel(); linktextlab.Text = "显示文本:"; ASPxTextBox linktext = new ASPxTextBox(); linktext.Width = ModuleField.Width; linktext.Height = ModuleField.Height; linktext.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired; linktext.ValidationSettings.RequiredField.ErrorText = "请输入链接显示文本!"; ASPxLabel linkurllab = new ASPxLabel(); linkurllab.Text = "输入网址:"; ASPxTextBox linkurl = new ASPxTextBox(); linkurl.Width = ModuleField.Width; linkurl.Height = ModuleField.Height; linkurl.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired; linkurl.ValidationSettings.RequiredField.ErrorText = "请输入链接地址!"; linkurl.ValidationSettings.RegularExpression.ErrorText = "格式不正确!"; linkurl.ValidationSettings.RegularExpression.ValidationExpression = "[a-zA-z]+://[^\\s]*"; if (ModuleField.CurrentValue != null) { int index = ModuleField.CurrentValue.ToString().IndexOf("||||||||||"); string text = ModuleField.CurrentValue.ToString().Substring(0, index); string url = ModuleField.CurrentValue.ToString().Substring(index + 10, ModuleField.CurrentValue.ToString().Length - index - 10); linktext.Text = text; linkurl.Text = url; } panel.Controls.Add(new LiteralControl("<table><tr><td>")); panel.Controls.Add(linktextlab); panel.Controls.Add(new LiteralControl("</td><td>")); panel.Controls.Add(linktext); panel.Controls.Add(new LiteralControl("</td></tr><tr><td>")); panel.Controls.Add(linkurllab); panel.Controls.Add(new LiteralControl("</td><td>")); panel.Controls.Add(linkurl); panel.Controls.Add(new LiteralControl("</td></tr></table>")); return(panel); }
protected override void LayoutContentControls(LayoutGroupTemplateContainer templateContainer, IList <Control> controlsToLayout) { LayoutGroupTemplateContainer layoutGroupTemplateContainer = (LayoutGroupTemplateContainer)templateContainer; if (layoutGroupTemplateContainer.ShowCaption) { // Outer Panel for setting the default style ASPxPanel outerPanel = new ASPxPanel(); outerPanel.Style.Add(HtmlTextWriterStyle.Padding, "10px 5px 10px 5px"); // Round Panel containing the Content Panel ASPxRoundPanel roundPanel = new ASPxRoundPanel(); roundPanel.Width = Unit.Percentage(100); roundPanel.ShowHeader = layoutGroupTemplateContainer.ShowCaption; if (layoutGroupTemplateContainer.HasHeaderImage) { ASPxImageHelper.SetImageProperties(roundPanel.HeaderImage, layoutGroupTemplateContainer.HeaderImageInfo); } // Content Panel ASPxPanel contentPanel = new ASPxPanel(); contentPanel.ClientInstanceName = templateContainer.Model.Id + "_ContentPanel"; // Set the RoundPanel Header Template roundPanel.HeaderTemplate = new HeaderTemplateEx(layoutGroupTemplateContainer.Caption, contentPanel); // Populate the controls roundPanel.Controls.Add(contentPanel); outerPanel.Controls.Add(roundPanel); templateContainer.Controls.Add(outerPanel); foreach (Control control in controlsToLayout) { contentPanel.Controls.Add(control); } } else { foreach (Control control in controlsToLayout) { templateContainer.Controls.Add(control); } } }
private void viewRender(ref ASPxPanel viewPanel) { //ASPxPanel viewPanel = new ASPxPanel(); ASPxHyperLink link = RenderHelper.CreateASPxHyperLink(); // new ASPxHyperLink(); ASPxLabel lblSize = new ASPxLabel(); ASPxLabel lblType = new ASPxLabel(); //iframe: PDF LiteralControl iframeShow = new LiteralControl();; if (PropertyValue != null) // && View != null { FileUploads file = (FileUploads)PropertyValue; //DetailView view = (DetailView)View; //System.Web.UI.WebControls.Panel layoutControl = ((System.Web.UI.WebControls.Panel)(view.Control)); link.Width = Unit.Pixel(200); link.BackColor = System.Drawing.Color.AliceBlue; link.Text = ((FileUploads)PropertyValue).Name; link.NavigateUrl = GetResolvedUrl(file.FileUrl); link.Target = "_blank"; lblSize.Text = this.convertByte((int)file.FileSize); lblSize.Font.Bold = true; lblType.Text = string.Format(" ({0})", file.FileType); lblType.ForeColor = System.Drawing.Color.DarkGray; iframeShow = new LiteralControl(string.Format("<iframe src=\"{0}\" style=\"width:100%; min-height:1200px;\"></iframe>", link.NavigateUrl)); } viewPanel.Controls.Add(link); viewPanel.Controls.Add(lblSize); viewPanel.Controls.Add(lblType); viewPanel.Controls.Add(new LiteralControl("<p><br /></p>")); if (CurrentObject is DocumentFile) { viewPanel.Controls.Add(iframeShow); } //return viewPanel; }