Hi
How to remove the line beneath UltraListViewGroup name? I have attached the screenshot for better understanding. The screenshot is having 3 listviews that are getting populated if the data exists in backend.
Please help... Its quite urgent...
Thanks in advance.
Assign an instance of this class to the control's CreationFilter property:public class GroupLineRemoverCreationFilter : IUIElementCreationFilter{ public GroupLineRemoverCreationFilter() { }
void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { UltraListViewGroupUIElement groupElement = parent as UltraListViewGroupUIElement; if ( groupElement != null ) { UltraListViewGroupHeaderLineUIElement lineElement = groupElement.GetDescendant( typeof(UltraListViewGroupHeaderLineUIElement) ) as UltraListViewGroupHeaderLineUIElement;
if ( lineElement != null ) groupElement.ChildElements.Remove( lineElement ); } }
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { return false; }}
Thanks for sending the code, I tried your code but its not working. The below code is written to create that UltraListViewGroup that is having line beneath "MCC Out Of Service" UltraListViewGroup myUltraListViewGroup = _ctrlControl.AddSystemGroup("System Group"); myUltraListViewGroup .Tag = "MCC Out Of Service"; myUltraListViewGroup .Text = "MCC Out Of Service"; myUltraListViewGroup .HeaderMargins.Top = 5; I just want to remove that line beneath "MCC Out Of Service". Its urgent... Thanks again.
There is a conditional in the code:
'If l_groupElement IsNot Nothing Then '
that you need to expand on. In addition to checking for null, compare l_groupElement.Group to the group from which you want to remove the line.
the above sample code will remove all the lines for all groups, right?. If I want to only remove the line beneath a specific group, what should I do?
Hello,
the coding of Brian is working. Here the VB version:
Friend Class GroupLineRemoverCreationFilter Implements Infragistics.Win.IUIElementCreationFilter Friend
Sub New() End Sub
Friend Sub AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) Implements Infragistics.Win.IUIElementCreationFilter.AfterCreateChildElements
If Not (parent.GetType Is GetType(UltraListViewGroupUIElement)) Then Exit Sub
Dim l_groupElement As UltraListViewGroupUIElement = CType(parent, UltraListViewGroupUIElement)
If l_groupElement IsNot Nothing Then
Dim l_lineElement As UltraListViewGroupHeaderLineUIElement = CType(l_groupElement.GetDescendant(GetType(UltraListViewGroupHeaderLineUIElement)), UltraListViewGroupHeaderLineUIElement)
If l_lineElement IsNot Nothing Then l_groupElement.ChildElements.Remove(l_lineElement) End If
End If
End Sub
Friend Function BeforeCreateChildElements(ByVal parent As Infragistics.Win.UIElement) As Boolean Implements Infragistics.Win.IUIElementCreationFilter.BeforeCreateChildElements
Return False
End Function
End Class
I confirmed that the code worked before I posted it; that will remove the line beneath the header for all groups. You were not specific about what aspect of it is not working, but if you mean that it is removing the line for all the groups and you only want to remove it for one, add a check for the specific group to the "if ( groupElement != null )" condition; you can get a reference to the group from the groupElement.Group property. If this is not the problem you will have to be more specific and/or attach a test project so we can take a look.