Hi,
I have a webdropdown with loadondemand enabled and enableautofiltering set to server. The datasource for the control is a datatable with 4000+ items.
I assign the datasource on every postback but i only do a databind when the page loads for the first time.
Load on demand works fine, but when i select an item that's further in the list, the selection is lost after a postback and jumps to the first visible item in the list. Is there a workaround for this behaviour?
I use netadvantage v2010.3
Sample code to reproduce the behaviour
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True"> </asp:ScriptManager> <ig:WebDropDown ID="WebDropDown1" runat="server" EnableLoadOnDemand="True" Width="200px" EnableAutoCompleteFirstMatch="False" EnableAutoFiltering="Server" PageSize="10"> </ig:WebDropDown> <asp:Button ID="Button1" runat="server" Text="Button" /> </form>
Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim dt As DataTable If Session("dt") Is Nothing Then dt = New DataTable("personen") dt.Columns.Add("userid", GetType(System.String)) Dim dr As DataRow Dim j As Integer = 100 For i As Integer = 1 To 4000 dr = dt.NewRow dr.Item("userid") = i dt.Rows.Add(dr) Next Else dt = CType(Session("dt"), DataTable) End If Me.WebDropDown1.DataSource = dt Me.WebDropDown1.TextField = "userid" Me.WebDropDown1.ValueField = "userid" If Not Me.IsPostBack() Then Me.WebDropDown1.DataBind() End If End Sub Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click Dim test As String = Me.WebDropDown1.SelectedItem.Text End SubEnd Class
Before postback:
After postback:
Any tips?
Thanks in advance!!
screenshot before postback:
Screenshot after postback:
No one?