Hi ,
We are using Infragistincs version 10.2 for asp.net.
We are trying do load on demand or lazy loading of 9000 records to webdropdown. These 9000 records are in a generic list. Initially the page loads and the webdropdown is filled with 20 records. When i scroll down , it is not loading the remaining list. Please suggest.
Following is the code i am trying to implement load on demand.
aspx page in form tag
<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <ig:WebDropDown ID="WddEmployeeMSC" runat="server" Width="200px" DisplayMode="DropDownList" TextField="Name" ValueField="Id" EnableMultipleSelection="false" EnableViewState="false" EnableLoadOnDemand="true" LoadingItemsMessageText="Loading" EnableAutoFiltering="Server" > </ig:WebDropDown> <asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClick="btnSubmit_Click" /> <asp:Button ID="btnPopulate" Text="PopulateData" runat="server" OnClick="btnPopulate_Click" /> </div> </form>
Following is the code behind and a class to create and bind generic list to webdropdown.
protected void btnSubmit_Click(object sender, EventArgs e) { var text = WddEmployeeMSC.SelectedValue; var value = WddEmployeeMSC.SelectedValue; } protected void btnPopulate_Click(object sender, EventArgs e) { List<NameList> NameList = new List<NameList>(); NameList name; for (int i = 1; i < 8500; i++) { name = new NameList() { Name = "Name" + i, Id = i }; NameList.Add(name); } WddEmployeeMSC.DataSource = NameList.ToList(); WddEmployeeMSC.ValueField = "Id"; WddEmployeeMSC.TextField = "Name"; WddEmployeeMSC.DataBind(); WddEmployeeMSC.Items.Insert(0, new DropDownItem("All", "All")); }
Following is the class
class NameList { public int Id { get; set; } public string Name { get; set; } }
Thanks in advance.
hey,
did you check my suggestion in the following thread, which I believe is about the same scenario ?
http://ko.infragistics.com/community/forums/p/80290/405309.aspx
What I am suggesting is to put the code to populate the dropdown in the Page_Load event, where the request is a postback (not initial load).
Hope it helps, let me know.
Thanks
Angel
Let me know if there is anything else I can help with and whether the proposed solution worked for you.
Hi Angel,
Thanks for the response , but now we have decided not to load so much data thinking infragistics can not support that much data. I will try now and see if in near feature if we get to implement this kind of solution i will implement. If I need any thing i will reply to this email .
Thanks again.