none
lookup dropdown with more than 20 items and the INDESIGN property

    Question

  • Hello,

    We run into the problem with the lookup dropdown being displayed differently when having more than 20 items.

    After searching on the web we found several solutions, some included SPServices, other javascripts.

    Those solutions seems to work for almost all the cases except for one of the lookup fields we had. The only difference that we noticed was that we have one additional column in the property "Add
    a column to show each of these additional fields:"

    Anyways, we found another solution that requires to change the INDESIGN property of the SharePoint:FormField to TRUE. It works like a charm! but we couldn't find any reference why.

    Can anyone explain to us why changing this property will fix the problem and if it may generate any other problem?

    Thanks

    Monday, January 28, 2013 7:25 PM

Answers

  • Hi,

    I understand that the lookup drop down renders differently when there are more than 20 items. Actually there are more conditions which will cause this lookup drop down to render different:

    if ((((this.DataSource != null) &&

        (this.DataSource.Count > 20)) &&

        (!base.InDesign && SPUtility.IsIE55Up(this.Page.Request))) &&

        !SPUtility.IsAccessibilityMode(this.Page.Request))

    {

        ....

    }

    The above code is get from the SP:FormField control source, you can see from the condition that if there are more than 20 items and the control is not in design mode, the lookup column will rendered differently instead of a single <select>. So when you change the InDesign to true, the condition will not meet and the lookup column will stilled be rendered as a <select>.

    For more information, please refer to this site:

    Advanced fixing SharePoint 2010 large lookup dropdowns: http://www.codeproject.com/Articles/194254/Advanced-fixing-SharePoint-2010-large-lookup-dropd

    Thanks,

    Entan Ming


    Entan Ming
    TechNet Community Support

    Tuesday, January 29, 2013 10:35 AM
    Moderator

All replies

  • Hi,

    I understand that the lookup drop down renders differently when there are more than 20 items. Actually there are more conditions which will cause this lookup drop down to render different:

    if ((((this.DataSource != null) &&

        (this.DataSource.Count > 20)) &&

        (!base.InDesign && SPUtility.IsIE55Up(this.Page.Request))) &&

        !SPUtility.IsAccessibilityMode(this.Page.Request))

    {

        ....

    }

    The above code is get from the SP:FormField control source, you can see from the condition that if there are more than 20 items and the control is not in design mode, the lookup column will rendered differently instead of a single <select>. So when you change the InDesign to true, the condition will not meet and the lookup column will stilled be rendered as a <select>.

    For more information, please refer to this site:

    Advanced fixing SharePoint 2010 large lookup dropdowns: http://www.codeproject.com/Articles/194254/Advanced-fixing-SharePoint-2010-large-lookup-dropd

    Thanks,

    Entan Ming


    Entan Ming
    TechNet Community Support

    Tuesday, January 29, 2013 10:35 AM
    Moderator
  • Where did you make this change?  I am using WSS and have 2 lookup fields that do not seem to be working correctly called District and School.  I am trying to find a simple way for those using IE to use these fields.  Right now I am telling folks to use Chrome as they work fine there.  I don't like this answer but it is all I've got until I can figure this out.  Thanks.
    Thursday, August 15, 2013 2:32 PM
  • There is no need for compiled code to resolve this issue - Simply add 2 lines of CSS to fix this!!!

    select
    {
        position: inherit !important;
        display: block;
    }

    • Proposed as answer by uzi mcwoozie Thursday, October 31, 2013 12:31 PM
    Thursday, October 31, 2013 12:30 PM