Search code examples
asp.netlistviewdatasourcebuttonclickradlistview

Lost listview datasource when button clicked


I have radlistview. I add datasource to listview when page_load. But when I clicked I button in same page. I lost datasource of listview. Why? how can I fix it?


Solution

  • I found the solution. I added EnableViewState="true" property and problem fixed. Like this

    <telerik:RadListView ID="lvDSTableSelection" runat="server" AllowMultiItemSelection="true" OnSelectedIndexChanged="lvDSTableSelection_SelectedIndexChanged" EnableViewState="true" >