Telerik UI for Winforms

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    2 posts
    Member since:
    Sep 2014

    Posted 07 Dec 2015 Link to this post

    I currently have the Winforms flavor of the Telerik UI SDK. I wish to take advantage of some of the WPF-like feature available in the Telerik UI for Winforms. Specifically ContainerNode. How do I get this downloaded and installed or is it already a part of the installed WinForms and if so where can I pull the reference DLL from. This example indicates that ContainerNode is a part of WPF

    Namespace: Telerik.Pivot.Core.Fields
    Assembly: Telerik.Pivot.Core (in Telerik.Pivot.Core.dll) Version: 2015.3.1103.1050 (2015.3.1103.1050)

    which I don't have. The code I want use is involved in managing the displayed parts of a DATE field in the field list control:

    Private Sub LocalDataSourceFieldDescriptionsProvider_ContainerNodeAdded(ByVal sender As Object, ByVal e As ContainerNodeEventArgs)
    'Use the name of the DateTime property, in our case it is Date
    If e.ContainerNode.Name = "Date" Then
    For Each containerNode In e.ContainerNode.Children
    Dim fin As FieldInfoNode = TryCast(containerNode, FieldInfoNode)
    If containerNode.Name = "Date.Year" Then
    'Remove Year from the DateTime tree
    TryCast(fin.FieldInfo, PropertyFieldInfo).AutoGenerateField = False
    End If
    Next containerNode
    End If
    End Sub

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 09 Dec 2015 Link to this post

    Hello Kevin,

    Thank you for writing.

    The ContainerNode class is located in the Telerik.WinControls.PivotGrid.dll assembly. By installing the WinForms suite, you should be able to reference it. The pivot control shares common code between WPF and WinForms and that is why you see the same namespace as in WPF.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kevin
    Kevin avatar
    2 posts
    Member since:
    Sep 2014

    Posted 15 Dec 2015 in reply to Hristo Merdjanov Link to this post

    If I code a sub like is shown in the online document:
    Private Sub LocalDataSourceFieldDescriptionsProvider_ContainerNodeAdded(ByVal sender As Object, ByVal e As ContainerNodeEventArgs)
        'Use the name of the DateTime property, in our case it is Date
        If e.ContainerNode.Name = "Date" Then
            For Each containerNode In e.ContainerNode.Children
                Dim fin As FieldInfoNode = TryCast(containerNode, FieldInfoNode)
                If containerNode.Name = "Date.Hour" Then
                    'Show Hour from the DateTime tree
                    TryCast(fin.FieldInfo, PropertyFieldInfo).AutoGenerateField = True
                End If
            Next containerNode
        End If
    End Sub

    And call it like this as is also shown, how is this going to not have syntax issues.
    Dim dataProvider = New LocalDataSourceProvider()
    dataProvider.ItemsSource = New Source()
    Dim descriptionProvider = New LocalDataSourceFieldDescriptionsProvider()
    descriptionProvider.AddingContainerNode += LocalDataSourceFieldDescriptionsProvider_ContainerNodeAdded
    dataProvider.FieldDescriptionsProvider = descriptionProvider

    And how do I go about deriving the ContainerNodeEventArgs, I am not seeing how the AddingContainerNode event is being triggered with the correct arguments passed.
  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 17 Dec 2015 Link to this post

    Hi Kevin,

    Thank you for writing.

    It looks like you are referring to an article from the documentation of the WPF version of the control. If this is the case please check our documentation here: RadPivotGrid.

    In order to achieve your task and modify the nodes of the RadPivotList control, you can access its nodes and according to your business logic hide certain items or check others. I am sending you attached a project demonstrating the suggested approach.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top