We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Event when changing the content of a label?

Thread ID:

Created:

Updated:

Platform:

Replies:

118844 Apr 15,2015 03:14 AM Apr 17,2015 03:14 AM Windows Forms 3
loading
Tags: Diagram
Walter Porada
Asked On April 15, 2015 03:14 AM

Hi there

Is there a way to get notified, when the text of a Label is changed by the user?
I´ve got a Group node, consisting of a rectangle with a fixed Label (not editable), an Image node and a Label node, which should be edited by the user.
I expected to get the "Property Changing"/"Property Changed" from the eventsink, but actually no event is being thrown.

Is there any way to get notified programatically when the user changed the text of an editable Label?

Using: VS2013/.NET 4.51/Winform/VB.NET/Release 13.1.0.21

with best regards,
Walter

Naganathan Ganesh Babu [Syncfusion]
Replied On April 16, 2015 01:06 AM

Hi Walter,


Thanks for using Syncfusion product.


We are unable to reproduce the reported behavior at our end. Please refer the below code snippet, video and sample for your reference.


Here is the code snippet:


[C#]


private void Form1_Load(object sender, EventArgs e)

{

Ellipse ellip = new Ellipse(100, 100, 100, 70);

ellip.Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(ellip, "Test"));

diagram1.Model.AppendChild(ellip);

//Property changed event to get Label Text changing event

diagram1.Model.EventSink.PropertyChanging += EventSink_PropertyChanging;

//Property changed event to get Label Text changed event

diagram1.Model.EventSink.PropertyChanged += EventSink_PropertyChanged;

}


void EventSink_PropertyChanging(Syncfusion.Windows.Forms.Diagram.PropertyChangingEventArgs evtArgs)

{

if (evtArgs.PropertyName == ".Text")

{

//Define the Logic

MessageBox.Show("Label Changing");

}

}


void EventSink_PropertyChanged(Syncfusion.Windows.Forms.Diagram.PropertyChangedEventArgs evtArgs)

{

if (evtArgs.PropertyName == ".Text")

{

//Define the Logic

MessageBox.Show("Label Changed");

}

}


Here is the video:


Video


Here is the Sample:


Sample


Please let us know if any concerns.


Regards,


Naganathan K G


Walter Porada
Replied On April 16, 2015 09:12 AM

Hi Naganathan

Allright. Now I see my mistake. I was subscribing to the Diagrams EventSink, not to the Models one.

Thank you for your assistance.

Regards,
Walter Porada

Naganathan Ganesh Babu [Syncfusion]
Replied On April 17, 2015 03:14 AM

Hi Walter,

Thanks for the update.

Please let us know if you require further assistance on this.

Regards,

Naganathan K G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;