Last post Oct 15, 2019 11:24 AM by geetasks
Oct 15, 2019 06:35 AM|geetasks|LINK
Listview contains Dropdown in Item Template and has other feature like Edit/Delete. Everything is working fine. The only issue is that when I change something from dropdown, listview is not refreshed. Though next time when it is postbacked, changed Data
comes. I am binding Listview with datatable. What can be the reason?
Before binding to DataTable, I had set datasource to null, so that it rebinds. Still it's not working
lvPDiet.DataSource = null; lvPDiet.DataBind();
Oct 15, 2019 07:33 AM|Yang Shen|LINK
There's an attribute called autopostback in Dropdownlist control, if you want this control's change event be fired, this attribute needs to be set to "true".
I believe your problem can be fixed by this little change rather than calling dropdown SelectedIndex changed method forcefully.
Or, you can provide your aspx code and let's see if there's other reason that might cause your problem.
Oct 15, 2019 09:16 AM|geetasks|LINK
Thanks for replying. But after setting DataSource to null, I had re-binded to datatable but it didn't display the refreshed data in dataTable. But if I click on say Edit, then new data(selected from dropdown) comes.
Oct 15, 2019 11:24 AM|geetasks|LINK
Solved the problem by calling dropdown SelectedIndex changed method forcefully. In Jquery, I had set a variable IsDDClicked=1 and in ListView Bind method, checked if Dropdown is clicked ie if IsDDClicked=1, then fired dropdown Selected index like: dlFndEqu_SelectedIndexChanged(null,