private Control CreateCollapsibleCardGroup(LayoutGroupTemplateContainer templateContainer, LayoutItemCSSInfoBase layoutCssInfo) { ASPxRoundPanel cardPanel = new ASPxRoundPanel(); cardPanel.ID = WebIdHelper.GetCorrectedLayoutItemId(templateContainer.Model, "", "_CardTable"); cardPanel.BorderWidth = Unit.Empty; cardPanel.HeaderTemplate = new CustomTemplate(templateContainer); new CollapsibleCardGroupSynchronizer(templateContainer, cardPanel); if (layoutCssInfo.ParentDirection == FlowDirection.Horizontal) { cardPanel.CssClass = layoutCssInfo.EditorContainerCssClassName; } else { cardPanel.CssClass = layoutCssInfo.CardCssClassNameCore; } SetCustomCSSClass(templateContainer.Model, cardPanel); WebControl cardGroupContent = new WebControl(HtmlTextWriterTag.Div); cardGroupContent.CssClass = CardGroupContentCssClassName; if ((!templateContainer.IsOnTabPage || templateContainer.ParentGroupDirection == FlowDirection.Vertical)) { cardGroupContent.CssClass += " CollapsibleContent"; cardPanel.AllowCollapsingByHeaderClick = false; cardPanel.ShowCollapseButton = true; cardPanel.HeaderStyle.CssClass = "GroupHeader Label"; if (templateContainer.HasHeaderImage) { cardPanel.HeaderImage.AlternateText = templateContainer.Caption; ASPxImageHelper.SetImageProperties(cardPanel.HeaderImage, templateContainer.HeaderImageInfo); } if (templateContainer.ShowCaption) { if (WebApplicationStyleManager.EnableGroupUpperCase) { cardPanel.HeaderText = templateContainer.Caption.ToUpper(); } else { cardPanel.HeaderText = templateContainer.Caption; } } else { cardPanel.HeaderText = ""; } ((ISupportToolTip)this).SetToolTip(cardPanel, templateContainer.Model); } else { cardPanel.ShowHeader = false; } cardPanel.Controls.Add(cardGroupContent); templateContainer.Controls.Add(cardPanel); return(cardGroupContent); }
private void GridOnFillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Columns) { var item = e.CreateItem(ColumnChooserAction.Caption, ColumnChooserAction.Id); ASPxImageHelper.SetImageProperties(item.Image, ColumnChooserAction.ImageName); e.Items[10].Visible = false; e.Items.Insert(10, item); } }
public void SetImage(ImageInfo imageInfo, string buttonText) { if (!imageInfo.IsEmpty) { ASPxImageHelper.SetImageProperties(Button.Image, imageInfo); Button.Text = ""; CssClass = "ParametrizedActionWithImage"; } else { ASPxImageHelper.ClearImageProperties(Button.Image); Button.Text = buttonText; CssClass = "ParametrizedAction"; } }
private void AddButtons(ASPxGridLookup control) { EditButton clearButton = new EditButton(); clearButton.ToolTip = CaptionHelper.GetLocalizedText("DialogButtons", "Clear"); ASPxImageHelper.SetImageProperties(clearButton.Image, "Editor_Clear"); control.Buttons.Add(clearButton); if (newObjectViewController.NewObjectAction.Items.Count > 0) { EditButton addButton = new EditButton(); addButton.ToolTip = CaptionHelper.GetLocalizedText("DialogButtons", "Add"); ASPxImageHelper.SetImageProperties(addButton.Image, "Editor_Add"); control.Buttons.Add(addButton); } }
public ASPxSearchDropDownEdit(WebLookupEditorHelper helper, string emptyValue, string displayFormat) { this.Helper = helper; this.EmptyValue = emptyValue; this.DisplayFormat = displayFormat; dropDown = RenderHelper.CreateASPxComboBox(); dropDown.ID = "DD"; dropDown.Width = Unit.Percentage(100); dropDown.CssClass = "xafLookupEditor"; dropDown.IncrementalFilteringMode = DevExpress.Web.IncrementalFilteringMode.Contains; dropDown.DropDownButton.Visible = false; dropDown.EnableCallbackMode = true; dropDown.CallbackPageSize = 10; dropDown.ItemRequestedByValue += new DevExpress.Web.ListEditItemRequestedByValueEventHandler(dropDown_ItemRequestedByValue); dropDown.ItemsRequestedByFilterCondition += new DevExpress.Web.ListEditItemsRequestedByFilterConditionEventHandler(dropDown_ItemsRequestedByFilterCondition); dropDown.TextField = Helper.DisplayMember.Name; dropDown.ValueField = Helper.LookupObjectTypeInfo.KeyMember.Name; //dropDown.ValueField = String.Format("{0}({1})", Helper.LookupObjectTypeInfo.ToString(), Helper.LookupObjectTypeInfo.KeyMember.Name); //TODO Add columns if (Helper.LookupObjectTypeInfo.Type.FullName == "MainDemo.Module.BusinessObjects.Contact") { dropDown.Columns.Add("FullName", "FullName", 300); dropDown.Columns.Add("SpouseName", "SpouseName", 300); dropDown.TextFormatString = "{0} {1}"; } newButton = dropDown.Buttons.Add(); clearButton = dropDown.Buttons.Add(); ASPxImageHelper.SetImageProperties(newButton.Image, "Action_New_12x12"); ASPxImageHelper.SetImageProperties(clearButton.Image, "Editor_Clear"); CellPadding = 0; CellSpacing = 0; Rows.Add(new TableRow()); Rows[0].Cells.Add(new TableCell()); Rows[0].Cells[0].Width = Unit.Percentage(100); Rows[0].Cells[0].Attributes["align"] = "left"; Rows[0].Cells[0].Attributes["valign"] = "middle"; Rows[0].Cells[0].Controls.Add(dropDown); }
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); } } }
public ASPxSearchDropDownEdit(WebLookupEditorHelper helper, string emptyValue, string displayFormat) { Helper = helper; EmptyValue = emptyValue; DisplayFormat = displayFormat; _dropDown = RenderHelper.CreateASPxComboBox(); _dropDown.ID = "DD"; _dropDown.Width = Unit.Percentage(100); _dropDown.CssClass = "xafLookupEditor"; // the following properties would be nice to be read from the model _dropDown.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith; _dropDown.FilterMinLength = 3; _dropDown.DropDownButton.Visible = false; _dropDown.EnableCallbackMode = true; _dropDown.CallbackPageSize = 10; _dropDown.ItemRequestedByValue += dropDown_ItemRequestedByValue; _dropDown.ItemsRequestedByFilterCondition += dropDown_ItemsRequestedByFilterCondition; _dropDown.TextField = Helper.DisplayMember.Name; _dropDown.ValueField = Helper.LookupObjectTypeInfo.KeyMember.Name; _dropDown.Columns.Add(Helper.LookupObjectTypeInfo.DefaultMember.BindingName); /*if (Helper.LookupObjectTypeInfo.Type.FullName == "MainDemo.Module.BusinessObjects.Contact") * { * dropDown.Columns.Add("FullName", "FullName", 300); * dropDown.Columns.Add("SpouseName", "SpouseName", 300); * dropDown.TextFormatString = "{0} {1}"; * }*/ _newButton = _dropDown.Buttons.Add(); _clearButton = _dropDown.Buttons.Add(); ASPxImageHelper.SetImageProperties(_newButton.Image, "Action_New_12x12"); ASPxImageHelper.SetImageProperties(_clearButton.Image, "Editor_Clear"); InitTable(); }
protected override void LayoutContentControls(LayoutGroupTemplateContainer layoutGroupTemplateContainer, IList <Control> controlsToLayout) { if (layoutGroupTemplateContainer.ShowCaption) { Panel panel = new Panel(); panel.Style.Add(HtmlTextWriterStyle.Padding, "10px 5px 10px 5px"); ASPxRoundPanel roundPanel = new ASPxRoundPanel(); roundPanel.Width = Unit.Percentage(100); roundPanel.HeaderText = layoutGroupTemplateContainer.Caption; if (layoutGroupTemplateContainer.HasHeaderImage) { ASPxImageHelper.SetImageProperties(roundPanel.HeaderImage, layoutGroupTemplateContainer.HeaderImageInfo); } AddControls(roundPanel.Controls, controlsToLayout); panel.Controls.Add(roundPanel); layoutGroupTemplateContainer.Controls.Add(panel); } else { AddControls(layoutGroupTemplateContainer.Controls, controlsToLayout); } }
protected override WebControl CreateEditModeControlCore() { if (_objectWindowAction == null) { _objectWindowAction = new PopupWindowShowAction(null, "ShowObjectDetailViewPopup", PredefinedCategory.Unspecified.ToString()); _objectWindowAction.Execute += objectWindowAction_OnExecute; _objectWindowAction.CustomizePopupWindowParams += objectWindowAction_OnCustomizePopupWindowParams; _objectWindowAction.Application = application; } _control = new ASPxButtonEdit { EnableClientSideAPI = true }; _control.Load += buttonEdit_Load; _control.Buttons.Clear(); _control.Buttons.Add(""); ASPxImageHelper.SetImageProperties(_control.Buttons[0].Image, "Editor_Search"); if (_control.Buttons[0].Image.IsEmpty) { _control.Buttons[0].Text = "Edit"; } _control.Enabled = true; _control.ReadOnly = true; return(_control); }
private WebControl CreateLayoutContentHeader(LayoutGroupTemplateContainer templateContainer, bool isCardItem) { WebControl div = null; if (templateContainer.ShowCaption && (!templateContainer.IsOnTabPage || templateContainer.ParentGroupDirection == FlowDirection.Vertical)) { div = new WebControl(HtmlTextWriterTag.Div); div.CssClass = "GroupHeader"; if (templateContainer.HasHeaderImage) { WebControl imageDiv = new WebControl(HtmlTextWriterTag.Div); ASPxImage imageHeader = new ASPxImage(); imageDiv.Controls.Add(imageHeader); imageHeader.CssClass = "Image"; ASPxImageHelper.SetImageProperties(imageHeader, templateContainer.HeaderImageInfo); imageHeader.AlternateText = templateContainer.Caption; div.Controls.Add(imageDiv); } WebControl labelDiv = new WebControl(HtmlTextWriterTag.Div); Label label = new Label(); labelDiv.Controls.Add(label); if (isCardItem && WebApplicationStyleManager.IsNewStyle && WebApplicationStyleManager.EnableGroupUpperCase) { label.Text = templateContainer.Caption.ToUpper(); } else { label.Text = templateContainer.Caption; } ((ISupportToolTip)this).SetToolTip(label, templateContainer.Model); templateContainer.CaptionControl = label; label.CssClass = "Label"; div.Controls.Add(labelDiv); } return(div); }
public override void SetImageName(string imageName) { ASPxImageHelper.SetImageProperties(CurrentMenuItem.Image, imageName); }
public override void SetImageName(string imageName) { ASPxImageHelper.SetImageProperties(_currentMenuGroup.Image, imageName); }