SharePoint 2010: Cascading Dropdown For Lookup With More Than 20 Items

Introduction

When your list reaches 20 items or more, SharePoint decided to automatically replace this simple, clean and elegant dropdown with a messy, sloppy and difficult-to-use Complex Dropdown. This is meant to be an upgrade. The text box, with jQuery behind it, allows users to type the item that they're looking for (that you can actually already do with a dropdown). However, in practice, it is prone to unexpected behavior.

Cause

I have a requirement to cascade a country and state dropdown in a SharePoint list. I have tried it using SPCascadeDropdowns and it's not working with more than 20 items in the child dropdowns. This shows my child dropdowns:

cascadedropdown

Solution

SimpleChild

If set to true, the child dropdown will be converted to a "simple" dropdown only if it is a "complex" dropdown on page load. Edit the page in the browser and add a Content Editor Web part, modify the web part and show the Source Editor to add the following code:

samplechild

edit in cascadedropdown

Summary

We made the cascading lookup to display more than 20 items successfully. The lookup column now works fine for more than 20 entries also.

Up Next
    Ebook Download
    View all
    Learn
    View all