Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
959
WebDropDown Load on Demand with 16K DataSet
posted

I have a WebDropDown that unfortunately has a large DataSet: currently 16470 rows. I'm trying to get Load On Demand working. It works great in DEV/UAT (DataSet is <1K) but not in PROD. In PROD I get "Server does not respond" when it attempts to load the next chunk of items into the dropdown. It seems to takea long time to rebind the DataSet on postback. Maybe I'm doing something inefficiently. Hoping someone can help.

<ig:WebDropDown ID="WebDropDownUpdate" runat="server" Width="800px" EnableViewState="False"
EnableAutoFiltering="Server" AutoFilterQueryType="Contains" AutoFilterResultSize="20"
AutoSelectOnMatch="False" ClientEvents-SelectionChanged="WebDropDownUpdate_SelectionChanged">
</ig:WebDropDown>

I have ViewState off because it helped with load times before enabling Load On Demand. The _SelectionChanged event writes the value to a hidden field for use later. I changed EnableAutoFiltering to "Server" after enabling Load on Demand.

On page load I save the DataSet to the session using a GUID that is generated and stored in another hidden field. This way it is unique to the page load as some users like to load the page in multiple tabs and use them simultaneously.

DataSet results = Common.GetDataSetSQL("EXEC [dbo].[GetReplacements] 'LIST'");
Common.SaveDataset(results, HiddenField_DropDownUpdateDataSet.Value);
WebDropDownUpdate.EnableLoadOnDemand = true;
WebDropDownUpdate.LoadingItemsMessageText = "Loading more items";
WebDropDownUpdate.DropDownContainerHeight = 200;

On postback I rebind to the DataSet retrieved from the session and reselect the previously selected item if needed.

// Rebind WebDropDownUpdate to allow load on demand
if (Session[HiddenField_DropDownUpdateDataSet.Value] != null)
{
    DataSet results = Common.ReadSavedDataset(HiddenField_DropDownUpdateDataSet.Value);
    if (results.Tables[0].Rows.Count != 0)
    {
        WebDropDownUpdate.DataSource = results;
        WebDropDownUpdate.TextField = "GroupName";
        WebDropDownUpdate.ValueField = "GroupName";
        WebDropDownUpdate.DataBind();
    }
    // Insert blank item as default selection
    WebDropDownUpdate.Items.Insert(0, new DropDownItem
    {
        Text = "",
        Value = "",
        Selected = true
    });
    // Set selected item
    if (HiddenField_DropDownUpdateSelection.Value != null)
    {
        WebDropDownUpdate.SelectedValue = HiddenField_DropDownUpdateSelection.Value;
    }
}

Do you see anything wrong, excessive, or missing?

  • 959
    Verified Answer
    Offline posted

    Everything is working now. Seems like the issue was environmental and restarting IIS resolved it. I made a minor change to the DataSet save/read to address shifting index on postback, but that was unrelated to the "server doesn ot respond" issue. Customer confirmed proper load on demand in PROD with 16K DataSet so everyone is happy.