Hi,
I am having a requirement to modify the header area of the UE groupbox to add custom text at runtime.
This cannot be done along side the caption.I need to change the color and size of the new text which is going to be displayed at runtime.
I added a UltraLabelControlUIElement to my GroupBoxHeaderUIElement
This is my class
Inherits Misc.UltraLabelControlUIElement
Public Sub New(ByVal parent As UIElement, ByVal label As UltraLabel)
End Sub
MyBase.Dispose()
End Class
These are my Methods
Implements Infragistics.Win.IUIElementCreationFilter.BeforeCreateChildElements
Return False
End Function
Implements IUIElementCreationFilter.AfterCreateChildElements
Dim lblRestriction As UltraLabel
If TypeOf parent Is GroupBoxHeaderUIElement Then
lblRestriction = New UltraLabel()
' create a new instance of MyUIElement to place in the Navigation Overflow Button Area
RC = GroupBoxHeader.RectInsideBorders
RC.Width = 150
RC.X = 500
ElementtoAdd.Rect = RC
ElementtoAdd.Label.Appearance.ForeColor = Color.Red
ElementtoAdd.Label.Appearance.BackColor = Color.Transparent
ElementtoAdd.Label.Text = "RESTRICTION"
ElementtoAdd.ChildElements.Clear()
' add the custom UIElement to its parent's ChildElements collection.
GroupBoxHeader.ChildElements.Add(ElementtoAdd)
End If
I am able to get the label on the groupbox header.I want to be able to change the text of this element at runtime.but this is simply not working.
I tried this code from main user control.
Dim elem As UIElement
If (Not (TypeOf (uegbPermitMainInfo.UIElement.ChildElements(1)) Is GroupBoxHeaderUIElement)) Then Return
For Each elem In GroupBoxHeader.ChildElements
If TypeOf elem Is PermitPanelsControlNew.MyUIElement Then
labelElement.Label.Text = "TEST"
' labelElement.
Next elem
Where am I going wrong.I am not able to display the changed text.it always shows the old text.which property should i manipulate.Please help.
Thanks
Padmini
Hello Padmini,
Did you find any solution for this. We have the same problem. We want to place label control on the header of the group box.
Looking forward for your reply.
Thank you