Query |
Response |
When I add/delete Node in the Nodecollection,if some event(collectionchanged) is triggered,then from the args i want to know which node is added/deleted and i have the update the properties of that node in this event and if possible i have to cancel the event. |
We have logged “CollectionChange event support in the blazor” as a feature. You can track the status of the feature from the below link.
Feedback link: https://www.syncfusion.com/feedback/12547/collectionchange-event-support-in-the-blazor
Note: As mentioned earlier, by using this event arguments we could not able to cancel the event, it will return only which node or connector is added/removed from the diagram. |
I also wanted to know if there is a possibility to have some constraints to stop these keyboard functionalities delete/cntrl + c/cntrl + v.
So I could use these constraints and customize the functionality on delete /add of nodes (In case if it is not possible to cancel the event)
|
We have command manager to disable the keyboard functionality. Please let us know whether you need a sample for it? |
<EjsDiagram Width="1000px" Height="700px" id="diagram" @ref="@diagram" Nodes="@NodeCollection" Connectors="@connectors">
@*Define events to handle command manager*@
<DiagramEvents OnCommandExecuted="@CommandExecute"></DiagramEvents>
@*Define command manager*@
<DiagramCommandManager Commands="@Commands">
</DiagramCommandManager>
</EjsDiagram>
//Define commands
List<DiagramCommand> Commands = new List<DiagramCommand>(){
//command Name should differ from the default value such as Copy, Paste
new DiagramCommand(){Name="copy1", Gesture= new DiagramKeyGesture(){ KeyModifiers = KeyModifiers.Control,Key= Keys.C} },
new DiagramCommand(){Name="paste2", Gesture= new DiagramKeyGesture(){ KeyModifiers = KeyModifiers.Control,Key= Keys.V} }
};
//Here you can override the clipboard command
public void CommandExecute(ICommandExecuteEventArgs args)
{
if (args.Gesture.KeyModifiers == KeyModifiers.Control && args.Gesture.Key == Keys.C)
{
// Do your own customization
}
if (args.Gesture.KeyModifiers == KeyModifiers.Control && args.Gesture.Key == Keys.V)
{
}
} |