Standard Controls inside of nodes on a Diagram

Hi,

We would like to make the diagram objects more interactive, thus enabling the user to click on say a button hosted in a node.

Is this possible and if so, from what class do we have to derive the node object to allow interaction with the contents hosted in a node object.

Currently every thing we try with the node system just gives us the standard controls where we have but a label to change.

Thanks
Andre

3 Replies

PM Pandi Murugan A Syncfusion Team August 18, 2010 01:49 PM UTC

Hi Andre,

Thank you for your interest in Syncfusion Product.

We suggest you to use ControlNode class to add controls in your diagram to make your diagram more interactive.You have to set the ControlNode's ActiveStyle property as one of Click,DoubleClik,None,ClickPassThrough and SelectedClick ActiveStyle's values.Please refer the following code snippet that demonstrate how to add ControlNodes to diagram.

C#

private void Form1_Load(object sender, EventArgs e)
{
this.InsertButton();
this.InsertListBox();
this.InsertCheckBox();
}
private void InsertListBox()
{
lst = new ListBox();
lst.Items.Add("Sunday");
lst.Items.Add("Monday");
lst.SelectedIndex = 0;
lst.SelectedIndexChanged += new EventHandler
(lst_SelectedIndexChanged);
ControlNode ctrlnode = new ControlNode(lst, new RectangleF
(50, 110, 100,30));
ctrlnode.ActivateStyle = ActivateStyle.Click;
this.diagram1.Model.AppendChild(ctrlnode);
}
void lst_SelectedIndexChanged(object sender, EventArgs e)
{
label2.Text = lst.SelectedItem.ToString();
}


We have created a sample for your reference.Please refer the following sample.

Forum-1808050942.zip

Please let me know if you have any concerns.

Regards,
Pandi Murugan A


AV Andre van Staden August 19, 2010 03:30 AM UTC

Thanks a million,

Your support is simply outstanding.

Regards
Andre


PM Pandi Murugan A Syncfusion Team August 21, 2010 06:44 AM UTC

Hi Andre,

Thanks a million for your feedback.

Please let me know if you have any other concerns.

Regards,
Pandi Murugan A

Loader.
Up arrow icon