This is a migrated thread and some comments may be shown as answers.

Telerik UI for Winforms

3 Answers 145 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 07 Dec 2015, 09:12 PM

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

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 Dec 2015, 12:28 PM
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
0
Kevin
Top achievements
Rank 1
answered on 15 Dec 2015, 07:43 PM
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.
0
Hristo
Telerik team
answered on 17 Dec 2015, 04:58 PM
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
Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or