Postback not updating bound listbox

19-Jan-2017 22:12

Sir, I am working with syncfusion Dropdownlist control in c# web i am doing postback on first dropdownlist selected index changed second dropdown get bind but selected value in first dropdown get vanished.please help in this issue.

Thanks We are unable to reproduce the issue with maintaining the Drop Down List selected value after post back.

For example you can store the selected index in a session variable and set this selected index after the databinding has been performed? On each postback however i have to set the datasource again from session for loadondemand to work.

You have to restore your selected state because the WDD cannot determine whether you are calling this Data Bind with a new data source or not and we wouldn't want persisted selection when data sources change. I only do a databind on the initial page load, so there is no databinding when a postpack occurs.

postback not updating bound listbox-46

As per your requirement we can achieve it by applying “Cascading” support to our Dropdownlist controls or by changing the Data Source of the other Dropdown list by using “On Value Select” server side event of our Dropdownlist control.

You can set it inside the Button_Click handler and restore the selected state and current value in Data Bound handler Hello, That seems to do the trick, many thanks! I have placed webdropdown in edittemplate of gridview control and binding this onrowbound of gridview, also we are selecting selected items form db incase of available.

Add(dr) Next Else dt = CType(Session("dt"), Data Table) End If Me. For example I can suggest you keeping the selected item in the session variable.

View Sate stores both the data of the List Box and the Selected Values.

That's one of the main reasons not to use View State on a list unless it just has a few values in it.

As per your requirement we can achieve it by applying “Cascading” support to our Dropdownlist controls or by changing the Data Source of the other Dropdown list by using “On Value Select” server side event of our Dropdownlist control.

You can set it inside the Button_Click handler and restore the selected state and current value in Data Bound handler Hello, That seems to do the trick, many thanks! I have placed webdropdown in edittemplate of gridview control and binding this onrowbound of gridview, also we are selecting selected items form db incase of available.

Add(dr) Next Else dt = CType(Session("dt"), Data Table) End If Me. For example I can suggest you keeping the selected item in the session variable.

View Sate stores both the data of the List Box and the Selected Values.

That's one of the main reasons not to use View State on a list unless it just has a few values in it.

This will help us provide you an alternative solution.