Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
WebDropDwon - value changed event problem
posted

ValueChanged Event and SelectionChanged Events are fired   always,  my requireement is like

If i entered  existing item valuechagechanged or selectionchange should fire,  if I enter New Item,  addItem event should fire,  but whenever i added new item  always valueChanged Event and SelectionChanged events are fired,  becaues of this page is always postback. 

how to achieve this

 

 

 

 

 

 

 

 

 

<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px"

 

 

EnableDropDownAsChild="False" onitemadded="WebDropDown1_ItemAdded"

 

 

ValueField="ProductID" TextField

="ProductName"

 

 

EnablePersistingCustomValues="True" AutoPostBack="True"

 

 

onselectionchanged="WebDropDown1_SelectionChanged"

 

 

onvaluechanged

="WebDropDown1_ValueChanged">

 

 

<DropDownItemBinding ValueField="ProductID" TextField="ProductName"

/>

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi,

    you can cancel the ValueChanging and SelectionChanging client-side events, if you don't want a postback to occur, depending on some condition:

    args.set_cancel(true);

    Also i would suggest to use the AutoPostBackFlags for ValueChanged and SelectionChanged, instead of AutoPostBack=True.

    Thank you,

    Angel 

Children
No Data