This is a migrated thread and some comments may be shown as answers.

Avoid valueChanged event on set_value?

4 Answers 59 Views
Input
This is a migrated thread and some comments may be shown as answers.
Bent
Top achievements
Rank 2
Bent asked on 15 Apr 2009, 03:10 PM
Hi there

Is there any way to avoid the valueChanged event from firing when setting a textbox value using set_value(...)?

Thanks

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Apr 2009, 03:42 PM
Hi Kenneth Siewers,

Yes, you can use _SetValue(...) instead of set_value(...)


Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Bent
Top achievements
Rank 2
answered on 15 Apr 2009, 04:54 PM
I guess I'm using some internal function then? Is there any danger in using function prefixed with "_" ? Normally I try to avoid using such methods as I don't know if I'm messing up some internal state etc.
0
Bent
Top achievements
Rank 2
answered on 15 Apr 2009, 05:16 PM
Okay, I've tested the solution, but it seems like there's a problem.

When the textbox is blurred it fires the event even though the values hasn't changed. I guess I can see the problem, as the set_value probably initializes the state, which now isn't set.

I can see the eventargs contains old and new value and old_value is an empty string.
0
Bent
Top achievements
Rank 2
answered on 15 Apr 2009, 05:23 PM
I guess I've figured it out. If I set the _initialValue = _SetValue the problem goes away. It's not pretty but it works.

It would be nice to have more control over the event triggering...
Tags
Input
Asked by
Bent
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Bent
Top achievements
Rank 2
Share this question
or