Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class IBlazorSelectionChangeEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class IBlazorSelectionChangeEventArgs

    Notifies when select or deselect any objects from the diagram.

    Inheritance
    System.Object
    IBlazorSelectionChangeEventArgs
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class IBlazorSelectionChangeEventArgs : Object
    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection">
           <DiagramEvents SelectionChanged = "Selection" ></ DiagramEvents >
    </ SfDiagram >
    @code{
       public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>();
       public void Selection(IBlazorSelectionChangeEventArgs args)
       {
           args.Cancel = false;
           if ((args != null) && (args.State == EventState.Changed) && (args.NewValue != null))
           {
               Console.WriteLine("Edited");
           }
       }
       protected override void OnInitialized()
       {
           // A node is created and stored in the node array.
           DiagramNode Node = new DiagramNode()
           {
               Id = "node1",
               Height = 100,
               Width = 100,
               OffsetX = 300,
               OffsetY = 100,
           };
           NodeCollection.Add(Node);
       }
    }

    Constructors

    IBlazorSelectionChangeEventArgs()

    Declaration
    public IBlazorSelectionChangeEventArgs()

    Properties

    Cancel

    Users can define whether the element can be selected.

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    System.Boolean

    Cause

    Returns the actual cause of the event.

    Declaration
    public DiagramAction Cause { get; set; }
    Property Value
    Type Description
    DiagramAction

    NewValue

    Returns the selected element after the event has triggered.

    Declaration
    public DiagramEventObjectCollection NewValue { get; set; }
    Property Value
    Type Description
    DiagramEventObjectCollection

    OldValue

    Returns the last selected elements, it's empty if previously, not objects have selected.

    Declaration
    public DiagramEventObjectCollection OldValue { get; set; }
    Property Value
    Type Description
    DiagramEventObjectCollection

    State

    Triggers before and after adding the selection to the object in the diagram which can be differentiated through state argument. We can cancel the event only before the selection of the object.

    Declaration
    public EventState State { get; set; }
    Property Value
    Type Description
    EventState

    Type

    Returns whether the item is added or removed from the list.

    Declaration
    public ChangeType Type { get; set; }
    Property Value
    Type Description
    ChangeType
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved