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. Image for the cookie policy date
close icon

Event when changing the content of a label?

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

3 Replies

NG Naganathan Ganesh Babu Syncfusion Team April 16, 2015 05:06 AM UTC

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



WP Walter Porada April 16, 2015 01:12 PM UTC

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


NG Naganathan Ganesh Babu Syncfusion Team April 17, 2015 07:14 AM UTC

Hi Walter,

Thanks for the update.

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

Regards,

Naganathan K G


Loader.
Live Chat Icon For mobile
Up arrow icon