OPC Studio User's Guide and Reference
MultiSelect Property (UADataDialog)
Example 



OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.UA.Forms.Browsing Namespace > UADataDialog Class : MultiSelect Property
Determines whether the dialog allows the user to select multiple nodes as output.
Syntax
'Declaration
 
Public Property MultiSelect As Boolean
'Usage
 
Dim instance As UADataDialog
Dim value As Boolean
 
instance.MultiSelect = value
 
value = instance.MultiSelect
public bool MultiSelect {get; set;}
public:
property bool MultiSelect {
   bool get();
   void set (    bool value);
}

Property Value

The default value of this property is False.

Remarks

When multi-select is enabled and the dialog allows the user to pick the OPC-UA endpoint, the count of endpoint descriptors must be the same as the count of node descriptors.

The getter method of this property is pure, i.e. it does not have observable side effects.

Example
// This example shows how to let the user browse for multiple OPC-UA data nodes (data variables or properties). 
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
// OPC client and subscriber examples in C# on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-CSharp .
// Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
// a commercial license in order to use Online Forums, and we reply to every post.

using System;
using System.Linq;
using System.Windows.Forms;
using OpcLabs.EasyOpc.UA.Forms.Browsing;

namespace UAFormsDocExamples._UADataDialog
{
    static partial class ShowDialog
    {
        public static void MultiSelect(IWin32Window owner)
        {
            var dataDialog = new UADataDialog
            {
                EndpointDescriptor = { UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer" },
                // or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
                // or "https://opcua.demo-this.com:51212/UA/SampleServer/"
                MultiSelect = true,
                UserPickEndpoint = true
            };

            DialogResult dialogResult = dataDialog.ShowDialog(owner);
            if (dialogResult != DialogResult.OK)
                return;

            // Display results
            MessageBox.Show(owner, 
                String.Join(Environment.NewLine, dataDialog.NodeElements.Select(element => element.ToString())));
        }
    }
}
' This example shows how to let the user browse for multiple OPC-UA data nodes (data variables or properties). 
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
' OPC client and subscriber examples in VB.NET on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-VBNET .
' Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
' a commercial license in order to use Online Forums, and we reply to every post.

Imports OpcLabs.EasyOpc.UA.Forms.Browsing

Namespace UAFormsDocExamples._UADataDialog
    Partial Friend Class ShowDialog
        Shared Sub MultiSelect(owner As IWin32Window)
            Dim dataDialog = New UADataDialog() With {
                .EndpointDescriptor = New OpcLabs.EasyOpc.UA.UAEndpointDescriptor With {
                    .UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
                    },
                .MultiSelect = True,
                .UserPickEndpoint = True
                }
            ' or "http://opcua.demo-this.com:51211/UA/SampleServer" (currently not supported)
            ' or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            Dim dialogResult As DialogResult = dataDialog.ShowDialog(owner)
            If dialogResult <> DialogResult.OK Then
                Return
            End If

            ' Display results
            MessageBox.Show(owner,
                String.Join(Environment.NewLine, dataDialog.NodeElements.Select(Function(element) element.ToString())))
        End Sub
    End Class
End Namespace
# This example shows how to let the user browse for multiple OPC-UA data nodes (data variables or properties).
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# Missing some example? Ask us for it on our Online Forums, https://www.opclabs.com/forum/index ! You do not have to own
# a commercial license in order to use Online Forums, and we reply to every post.
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System.Windows.Forms import *
from OpcLabs.EasyOpc.UA.Forms.Browsing import *


dataDialog = UADataDialog()
dataDialog.EndpointDescriptor.UrlString = 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'
# or 'http://opcua.demo-this.com:51211/UA/SampleServer' (currently not supported)
# or 'https://opcua.demo-this.com:51212/UA/SampleServer/'
dataDialog.MultiSelect = True
dataDialog.UserPickEndpoint = True

dialogResult = dataDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
    exit()

# Display results.
for nodeElement in dataDialog.NodeElements:
    print(nodeElement)

print()
print('Finished.')
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also