Current filter:
                                You should refresh the page.
                                0
                                  • Hello


                                    I create a XRLabel in code for the EUD.

                                    I set the Label.Name to "XrLabelABC".

                                    But the Designer set the Name to "label1".


                                    What do I wrong?


                                    	
                                    [VB.NET]
                                    Private Function CreateWatermarkOffsetLabel() As XRLabel Dim xrLabelABC As New XRLabel Dim host As IDesignerHost = XrDesignMdiController1.ActiveDesignPanel.Report.Site.GetService(GetType(IDesignerHost)) Dim rep As ProcessReport = host.RootComponent xrLabelABC.Dpi = 254.0! xrLabelABC.LocationFloat = New DevExpress.Utils.PointFloat(0.0!, 0.0!) xrLabelABC.Name = "XrLabelABC" xrLabelABC.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!) xrLabelABC.SizeF = New System.Drawing.SizeF(254.0!, 5.0!) xrLabelABC.StylePriority.UsePadding = False xrLabelABC.Text = """" rep.WatermarkDistance.Controls.Add(xrLabelABC) ' for designer usage DesignToolHelper.AddToContainer(host, xrLabelABC) Return xrLabelABC End Function

                                    

                                You must  log in  or  register  to leave comments

                                2 Solutions

                                Creation Date
                                Rating
                                Importance
                                Sort by
                                0

                                Hello Stefan.

                                Thank you for your message. To solve this issue, pass your "name" value to the xrLabel.Site.Name property after adding this label to a Container:

                                	
                                [VB.NET]
                                Private Function CreateLabel(name As String, controlDestination As XRControlCollection, binding As XRBinding) As XRLabel Dim xrLabel As New XRLabel Dim host As IDesignerHost = CType(XrDesignMdiController1.ActiveDesignPanel.Report.Site.GetService(GetType(IDesignerHost)), IDesignerHost) Dim rep As XtraReport = CType(host.RootComponent, XtraReport) ' Im Designer hinzufügen, damit die Controls selektiert und Properties verändert werden können DesignToolHelper.AddToContainer(host, xrLabel) If binding IsNot Nothing Then xrLabel.DataBindings.Add(binding) End If xrLabel.LocationF = New PointF(50, 50) xrLabel.Dpi = 254.0! 'xrLabel.Name = name xrLabel.Site.Name = name 'Add this line xrLabel.Padding = New DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 254.0!) xrLabel.StylePriority.UsePadding = False xrLabel.Text = "" controlDestination.Add(xrLabel) Return xrLabel End Function

                                We look forward to your feedback once you have had the opportunity to try our solution.

                                You must  log in  or  register  to leave comments
                                0

                                Hi Stefan,

                                Adjust the XRLabel.Name property to fix this issue. We look forward to your feedback once you have had the opportunity to try this approach.

                                • Stefan Bättig 08.03.2012

                                  i did it already. see my code!

                                • I suggest that you define XRLabel.Name property after calling DesignToolHelper.AddToContainer method. If it does not help you, please post a sample project that illustrates the problem. We will examine it and try to find an appropriate solution for you.

                                • Stefan Bättig 08.06.2012

                                  show my sample. it seems to be a bug.
                                  do you have a workaround for me?

                                You must  log in  or  register  to leave comments
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.