Hi Nagaraj,
I'm confused by your response. I would like to have a node, we'll say it's a composite node, composed of an ellipse node and a text node. I would like to be able to group this composite node with other diagram shapes (or nodes). I would also like to ungroup this composite shape when it's grouped with other diagram shapes.
I do not want to prevent grouping and I don't want to prevent ungrouping. I want to protect the grouping of the composite shape, not any grouping of this composite shape with other diagram shapes.
Does this makes sense? Will your example satisfy this?
Jeff
>Hi Jeff,
Sorry for the delay in getting back to you.
If you want to prevent the Grouping action afer you ungroup the node, then you have to derive the Controller class. . In Controller class UnGroup() method is declaed as public. So you can't override this. So better you can hide the base class UnGroup() method. If you want to call base class method then you can use nase.UnGroup() in CustomDiagramController classPlease refer to the following code snippet
class MyDiagram : Syncfusion.Windows.Forms.Diagram.Controls.Diagram
{
public MyDiagram()
{
}
public override Model CreateModel()
{
return new MyModel();
}
public override Syncfusion.Windows.Forms.Diagram.View CreateView()
{
return new MyView();
}
public override DiagramController CreateController()
{
return new CustomDiagramController();
}
public class CustomDiagramController : Syncfusion.Windows.Forms.Diagram.DiagramController
{
public CustomDiagramController()
{
}
//Use new method to hide base class method. Use "base.UnGroup()" method to call base class UnGroup() method
public new void UnGroup()
{
}
}
//To call the hidden UnGroup method
private void ungroupToolStripMenuItem_Click(object sender, EventArgs e)
{
((CustomDiagramController )this.newdiagram.Controller).UnGroup();
}
I have attached the sample for your reference. You can download the sample from the following page
http://websamples.syncfusion.com/samples/Diagram.Windows/PreventUnGroping/main.htmPlease let me know if you have any questions.
Regards,
Nagaraj