Monday, February 2, 2009

Cascading Drop Down List (With Filter) - Custom Field Control

The excellent SharePoint - Cascading Drop Down Lists provided by DataCogs is a great way to create relationships between fields/columns in SharePoint lists.

DataCogs Solution Page:
http://datacogs.com/datablogs/archive/2007/08/26/641.aspx

This was further enhanced by Patrick Tisseghem to allow a grandchild dropdown. Visit Patrick's Page at:
http://blog.12thwave.com/?p=7

Expanding on Patrick's modified version to allow a grandchild dropdown list, I've added the functionality to filter the items in the dropdown.

Also, the "Required Field" validation was not validated accurately and this has been taken care of in my modified source.

Below find a few screenshots of configuring and using the custom field -

I have a list called 'Continents':


A second list 'Countries':


And a third list 'Cities':


In my fourth list 'My Location' in which I would want to have the three dropdowns displayed, I create three columns : Continent, Country and City using my custom field 'Cascading Drop Down List (With Filter)'.



The three columns created are -


Configuring the columns and using the filter -








When adding a 'New Item' to the 'My Location' list, the first dropdown will have "Please select an Item' (which is also something I added) as the first item in the dropdown.

Cascading Drop Down List (With Filter) in action:



According to the filter set, the list of continents that appear are only the ones that contain 'America'.







Many thanks to Datacogs and Patrick for their valuable contribution to the SharePoint community.

For the solution file (.wsp) and complete source code, please visit the project page at:
http://cascddlistwithfilter.codeplex.com/

Please feel free to post your comments/suggestions.

122 comments:

  1. The above works fine where the names are all unique in the child. However if there are (eg) several cities with the same name but in different states, then all states will show the same city multiple times.

    This can be got around by creating a composite key field in your child and grandchild lists that concatenates the parent + child keydata in the same field. In short, you perform the one-many join in the lists manually because you can only have one connect column in the child.

    With this technique we are able to have the same city name in many different states but only one city will appear in the cascaded list for a given state.

    Also, what would be really spiffy is to use just one list, not three, by having the parent filter use just the distinct values on the list.

    Anyhow it all works well. Great stuff!!

    ReplyDelete
  2. @Marcus : Thank you for your comments and feedback.

    "The above works fine where the names are all unique in the child. However if there are (eg) several cities with the same name but in different states, then all states will show the same city multiple times."

    With respect to the above, I tested this out and and the city name does not appear multiple times under each state. In my case, using the same lists as mentioned in the blog, I added a new city "New York" with the country set to Canada. So I had two cities with the same name but under different countries. Now when I view the items in the drop down, on selecting USA, I see the cities New York and San Francisco. And when I select the country as Canada, I see only Ottawa, Montreal and New York (the new entry I added).

    So I'm not sure why they appear multiple times in your instance.

    ReplyDelete
  3. i have problem here...

    when i have add solution to the site and deploy the solution... its success...~

    but why i cant activate the features... not just cant activate but also theres nothing in the site features or site collection features...

    please help me... this is so weird...
    are there any solution to solve this problem?

    thanks and regards,
    YougyZ

    ReplyDelete
  4. Hi YougyZ,

    When you add and deploy the solution, it will not appear as a site feature. You will see the new column type automatically when you create a new column. Hope this helps. Please let me know if this solves the problem.

    Regards,
    Sarith

    ReplyDelete
  5. Do you have instructions on how to install this solution?

    Thank you.

    ReplyDelete
  6. @Sarith: WRT multiple cities, it works because both "New Yorks" are in the same continent. If you create "New York" in Europe, France, then you should see 2 New Yorks in both France and USA.

    IMHO, this is because only the immediate parent is used to filter values for the current DDL. The value(s) selected in preceeding grandparents, greatgrandparents(etc) are apparently ignored.

    However, I'm happy to be corrected if I've overlooked something :-)

    ReplyDelete
  7. @Sarith: ...I also just noticed a few errors building up in our SP log files. We are having problems getting this to work beyond a simple CDDL as documented above. However, its the best offering so far, so dont take it as a critisism :-).

    The two warnings are:

    An SPRequest object was not disposed before the end of this thread.
    To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.
    This object will now be disposed. Allocation Id: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
    To determine where this object was allocated, create a registry key at
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings.
    Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.

    ...and....

    Potentially excessive number of SPRequest objects (9) currently unreleased on thread 12.
    Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed.

    ReplyDelete
  8. Ok I have a suggested fix for the above...

    In CascadingDropDownListFieldControlWithFilter.cs the SPSite objects are not Disposed. This is done correctly in CascadingDropDownListFieldEditControlWithFilter.cs so its just a case of applying the same code in the other file.

    ReplyDelete
  9. Sorry I've been travelling on business and very limited access to the internet.

    @marcus: Thank you for your inputs and suggestions. I'll make the necessary changes and post the updated code sometime soon.

    I've seen some comments in the project discussion forum on codeplex with regards to the column not showing up in the list of column types when creating a new column in a list. I'll investigate and get back in a day or two. Please bear with me, and tnd thanks for your comments and suggestions.

    ReplyDelete
  10. @South64: I've uploaded a solution installer in the codeplex project page as a patch. Just run the setup and follow the onscreen instructions.

    However, if you face the problem of not seeing the column type when creating a new column, I'll be investigating and posting a reply in a day or two.

    Thanks.

    ReplyDelete
  11. Hi Sarith, I am having the issue of not being able to see the column type when creating a new column. Looking forward to your update.

    Thanks very much.

    ReplyDelete
  12. Hi Sarith,
    Regarding the issue people are having deploying (and I still have the issue with the installer you've uploaded to codeplex), in the source you have a post build event to copy the ascx and xml files which I assume is not in the package. When I manually copy them to the server after running the installer everything works fine.
    Cheers, Martin

    ReplyDelete
  13. UPDATE** : I've uploaded the latest version of the solution which fixes the deployment related problem.

    Thanks to Martin for pointing out my silly oversight.

    Cheers,
    Sarith

    ReplyDelete
  14. Hi Sarith,

    Love the enhancements to this field, but I am having an issue when I back and restore a site that uses this field to another sharepoint web app.
    The lists work fine, but when I try to edit the field configuration the following error appears:

    Object reference not set to an instance of an object. at Stoneshare.CascadingDropDown.WithFilter.CascadingDropDownListFieldEditControlWithFilter.loadLists()
    at Stoneshare.CascadingDropDown.WithFilter.CascadingDropDownListFieldEditControlWithFilter.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at Stoneshare.CascadingDropDown.WithFilter.CascadingDropDownListFieldEditControlWithFilter.InitializeWithField(SPField field)
    at Microsoft.SharePoint.ApplicationPages.FieldCustomizationPage.OnLoad(EventArgs e)
    at Microsoft.SharePoint.ApplicationPages.FieldEditPage.OnLoad(EventArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint

    I think it has to do with the hard coded URL when it attempts to load the lists.

    Can this error be trapped so it doesn't crash and allows the user to modify the URL in the new site. This would really help for deployment of site templates with this field embedded?

    ReplyDelete
  15. Hi Sarith,
    I have found a bug in dealing with sites where a field name has been changed.
    The problem is the following: when you setup the cascading field, you can choose the fields from the referenced lists and you can see the actual names, which is not the original name of the field, but the actual modified name.
    Anyways, when you try to modify any element in the list, there is an unknown error. This errors occurs because it uses such name to do the lookup, but in reality, in the back, it should use the original name, which is the one used in the database.
    To reproduce, as an example, create a new list, change the name of the Title field and then try to lookup on that field from another list.
    I have found a workaround: temporarily change the name of the field in the list to the original name, setup the lookup field and then put the name back to the one that you want. In such a way it works

    ReplyDelete
  16. Fantastic work! If we get it working, it changes the game for making Sharepoint taxonomy a reality at my company.

    Here's my challenge that it making me feel like an idiot. I tried to duplicate the example above. Continent and Country are working fine, but it never populates the cities. Any ideas?

    ReplyDelete
  17. Sorry guys... I've been traveling and have not been able to give this the attention it deserves. I'll review the discussion posts and comments on my blog and will post my feedback in a couple of days. Please bear with my inconsistencies and lack of frequent updates.


    Peace,
    Sarith

    ReplyDelete
  18. Update:
    After installing the solution, if you do not see the column type when creating a new column, please restart the server.

    ReplyDelete
  19. @Anonymous (Problem with cities not being populated):

    Can you please check the configuration to make sure the parent and child control names are entered correctly?

    If you still face a problem, can you please post details of your fields and the columns in them?

    Thanks.

    ReplyDelete
  20. Hi Sarith, Love your work. I basically setup your solution and restart the server (that part got me for a while ;) )

    However, my problem is for the child and grand child Im using the same list. but when I select a parent it doesnt update the child list until i click ok n go back to edit it. same for the grandchild

    Any ideas on this? or is it purely because im not using 3 seperate lists?

    Many Thanks,
    Troy

    ReplyDelete
  21. Hi Troy,

    Thank you for your post.

    I haven't tested this field using the scenario you described. However you could test it with 3 seperate lists and if you have no problems, then we can safely conclude that they have to be 3 seperate lists. :) Perhaps we could include this in the wish list of the things to look at in the new version.

    Cheers,
    Sarith

    ReplyDelete
  22. Thank you for the great post.
    It is very helpful. I have the same problem as the other Anonymous person.
    My city does not work:I did the exact work I did for the country, but it does not show my city options.
    Thank you for your attention and concern to this matter.

    ReplyDelete
  23. Please ignor the previous note of mine.
    It was a stupid mistake from my site.
    I did not add the City as the Child name in Country column.
    Thank you for your great work. :)
    with respect,
    Roxy

    ReplyDelete
  24. Hi Sarith,
    this is great work. You've saved me from writing code :)

    To all that have multiple entries in their lists: change the "column for value" to be a unique column (I use id, unfortunatelly text columns do not seem to be supported, is that right Sarith?) and use that column for your parent/child relations. Works great for me and it will for you :)

    Cheers

    ReplyDelete
  25. Does this work in the Office 2007 DIP (Document Information Panel)?

    Regards, Mike

    http://www.sharepointu.com/mossms/default.aspx

    ReplyDelete
  26. Hi Mike,

    First off.. great post on your blog on the Filtered Lookups Across Content Types.

    With regards to the CDDL with filter, the properties cannot be edited thru the document properties panel. The properties for these fields will have to be edited on the server.


    Cheers,
    Sarith

    ReplyDelete
  27. Sarith,

    This is a great custom column. If you happening to be taking requests on future enhancements I have one. It would be nice to have the data in the drop downs be sorted.

    Again very nice work and thank you for all of your efforts. Chad

    ReplyDelete
  28. Hi Sarith,

    I'm new to sharepoint. I installed Patrick's solution and it works perfectly.

    Now my question is, how easy would be to alter your code so the last dropdown is not a dropdown but a textbox? Basically what I want to achieve is that once all the previous dropdowns have been selected, we get a texbox at the end with a summary text. This summary text would be a column called "summary" in the "Cities" custom list.

    Thanks very much in advance.

    ReplyDelete
  29. Hey Sarith,

    I am here to give you congratulations on your explendid work, and also, (of course) to ask you if you can put some info on how to filter information to see.~

    I've tried CAML with and without the query statement, and could not make it work... or it gives me everytinh or nothing.

    Thank you for your great piece of work.

    Best regards

    ReplyDelete
  30. Go back to site
    Error




    when i add the column to my list & try to edit / add new ..i get


    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.






    when i add the control to my list and try to addnew / edit it gives :

    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.

    any suggestions.

    ReplyDelete
  31. i want to places your CDDL at the workflow initiation page via sharepoint designer. (i using Charlie's trick at http://f5todebug.wordpress.com/2009/01/16/people-picker-for-sharepoint-designer-workflow-initiation/)

    can you describe how to place CDDL in aspx page with sharepoint designer ?

    ReplyDelete
  32. I have the same error

    Go back to site
    Error




    when i add the column to my list & try to edit / add new ..i get


    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.






    when i add the control to my list and try to addnew / edit it gives :

    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.

    Go back to site
    Error




    when i add the column to my list & try to edit / add new ..i get


    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.






    when i add the control to my list and try to addnew / edit it gives :

    An unexpected error has occurred.
    Troubleshoot issues with Windows SharePoint Services.

    any suggestions?

    Gregory Mitt

    ReplyDelete
  33. does this work in wss 3.0?

    tried to use the installer but can't install as it's asking for a moss 2007 installation when the installer is run.

    Anis

    ReplyDelete
  34. Can you assist in uninstalling your module?

    As its not clear where this gets installed based on me searching.

    My problem is the install didnt work correctly and I dont believe any files were copied.

    SP now believes this feature is installed but I cant find references of it or files that were changed.

    How can I remove all instaces of this installation?

    ReplyDelete
  35. Sarith,
    THANKS... great feature. It took me a full day to get it installed and working correctly on our test box. Heads up to those that folow me:
    #1)
    Installation said there was and error and it did not install: I watched it roll back. Tried installing again and it said it was already installed but there was not sign of the column type. I had to go into Central Admin/Solution management and "Deploy" .wsp. Still no sign. IIS reset didn't help. Rebooting the server DID!!
    #2)
    The lists you use CANNOT have a space in the name. This took me hours of headscratching.

    ReplyDelete
  36. Field type DropDownListaCascadeField is not installed properly. Go to the list settings page to delete this field. at Microsoft.SharePoint.SPFieldCollection.CreateNewField(String typeName, String displayName) .

    I installed without wsp.
    1.Install Gac
    2.edit web config
    3.put the ascx in ../12/Template/ControlTemplates
    4.put xml in ../12/Template/XML folder

    is something missing?

    ReplyDelete
  37. hello

    i used the webpart, with installer, from codeplex in a MOSS 2007, English Version onto W2k3 English and everything works fine.
    If i try to use in a WSS 3.0, Italian version (with english language pack) onto w2k3english i get the error that verious anonymous posted above (sharepoint generic error)
    furhtermore if i use everywhere and always ID as a column (for value, for test and for lookup) the solutions works (showing unuseful numers instead of useful text, of course).

    if i use previous version from http://blog.12thwave.com/?p=7 (without filter feature) it works fine

    can you provide for a web part working with both MOSS and WSS?

    thanks

    ReplyDelete
  38. Hi Sarith, thanks for a great webpart, and thanks for sharing! It works great on my site!
    I was wondering if it is easy to modify the part so that I can select multiple items (I.e. as with standard lookup columns "Allow multiple values") My 3 lists are Products, Parts and Failures and as there can be many Failures in a single Part the user needs to be able to select multiple values.

    Thanks
    Lisa

    ReplyDelete
  39. UPDATE

    Troubleshooting errors related to installation/uninstallation:

    During installation of the solution using the install wizard, if the installer encounters an error, the wizard automatically rolls back the installation. However, in some instances when users try to reinstall the solution, they get an error message "the solution already exists". In such cases, go to Central Admin -> Application Management -> Solution Management and verify the solution does not appear in the list. If the solution exists, retract the solution and then remove it. After removing the solution, reboot the server.

    END UPDATE

    ReplyDelete
  40. ERROR:
    An unexpected error has occurred

    POSSIBLE CAUSE:
    The fields are not configured properly.

    ReplyDelete
  41. @ Anonymous (Manually installed the solution):

    When do you see this error? When you try to add a new item to the list or when you open a/any view of the list?

    If you see the error when trying to add an item to the list, it probably means your field is not configured properly.

    ReplyDelete
  42. Hi Davide,

    I noticed the issue you raised on codeplex and am looking to replicate your issue. I believe this has something to do with italian version, since a similar issue was reported by another user with italian version. Will update you in a couple of days.

    Cheers,
    Sarith

    ReplyDelete
  43. UPDATE:

    I've added instructions on installing the solution on a WSS farm.

    Please visit the project documentation page here -

    http://cascddlistwithfilter.codeplex.com/documentation


    END UPDATE

    ReplyDelete
  44. Hi Sarith,

    I've followed your instrucctions for WSS installation and I get the error ("Object reference not set to an instance of an object." )

    Anyway, the solution appears in the "solution management" site. So I deploy it handly, and I can see the solution column option. I configure the columns but I get the error (An unexpected error has occurred). I'm trying to relacionate two tables (employers, enterprises).
    I'm wondering wether the trouble is the installation error or wether the troble is the column configuration.
    Please, let me know.

    Thanks.

    ReplyDelete
  45. UPDATE

    I've uploaded a new release that fixes the "Object reference not set to an instance of an object" error.

    The reason for this error was because the solution id in the setup.exe.config file did not match the solution id on the manifest.xml file.

    Please visit the project page on CodePlex to download the latest release.

    Happy SharePointing...

    END UPDATE

    ReplyDelete
  46. You might want to look at my jQuery Library for SharePoint Web Services (http://spservices.codeplex.com). It offers similar functionality entirely client-side. Nothing to install of activate.

    M.

    ReplyDelete
  47. Wow, this is a GREAT piece of code. Thanks!

    got a question: is it possible to have this work with (asp.net) drop-down lists in Sharepoint Designer, and how? I want to use the Cascading Drop-Down to filter a data view, as in the following screenshot (obviously this is a fabricated example!)
    http://i50.tinypic.com/9arcs3.gif

    many thanks!
    chris

    ReplyDelete
  48. Hi Sarith,
    This is a great feature.
    Obviously this works great to filter with columns of type TEXT, but have you had success getting this to work with columns of type LOOKUP? I'd like to store the ID & TEXT together like a LOOKUP column does, but your feature only filters on TEXT values.
    Thanks for any ideas,
    david

    ReplyDelete
  49. Hi Sarith
    i really need your solution but i cannot use it
    for persian language sitecollection, after setting fields, i always get an unexpected error
    please help me to set

    hanieh.hvariani@gmail.com

    ReplyDelete
  50. What is MyCountries ? I thought the list was called Countries.

    Why does the Countries list have a column for Counties, if Title has the countries.

    We see muliple entries for titles when selecting columns during configuration, does it matter which one you choose?

    I can't seem to get this to work, I've never installed MOSS SP1 OR SP2 and don't have .net 3.5, does this matter?


    sales(at)cyberpine(dot)com

    Thanks.

    ReplyDelete
  51. I'm trying this with one parent and one child list only.

    When I attempt new on the Location I get this due to the child column.

    One or more field types are not installed properly. Go to the list settings page to delete these fields.

    If I remove the child column from Location the error goes away.

    ReplyDelete
  52. Hi Sarith,
    great work!!!!
    I have only one problem, mentioned above previously. Is it possible to sort the lookup view for the choice? I get many Dates and Times for my choice to an make an appointment. Without sorting it´s difficult do find free dates.
    Thx to all hints

    ReplyDelete
  53. Hi Sarith

    We have installed your solution file on out web application and it all works great. On the NewForm I have got another webpart which uses a web service and pass a value to the form. When I select a value from the drop down list it vanishes. Any ideas?

    ReplyDelete
  54. Dear Sarith, I tried on two servers but did not manage to get the things to work.

    I always get an error message:

    "DataBinding: 'System.Data.DataRowView' does not contain a property with the name '....'.

    I'm pretty sure that I filled all the fields correctly but I keep getting this message on different servers and with different lists.

    Thanks,
    Hrvoje

    ReplyDelete
  55. Sarith, I've been struggling to get this working. I've tried to be simple and just connect two lists, but always get an "unexpected error" when trying to add or edit an entry. I've set up a list call LUInfraSystems that has a title column and a SystemInfra column (which contain the same data at this point). I have a second list that has title, SubsystemInfra and SystemInfra as columns, with title and SubsystemInfra currently the same data and SystemInfra contains data that would match an entry in the other list under SystemInfra. I can display these files individually fine in a third list as columns if only using a parent. However, when I use LUInfraSystems as a parent and LUInfraSubsystems as a child, and use the column SystemInfra as link, I get the error. I have validated that the names I'm using for parent and child are consistent, but I must be missing something. Is there something obvious I might have wrong here? Thanks.

    ReplyDelete
  56. I have made some progress on this. The columns I was using were ones I had defined at a site level. When I deleted these and only defined them at the list level, then I seemed to get the parent and child lists to link together. Once I got this working, then I had some challenges getting the search field to work, where I was selecting a third column to do the search on. Eventually, I got this to work by changing the column name to something other than I was originally using. Seems to be pretty sensitive to something relative to column names.

    ReplyDelete
  57. Hi,

    Your solution has been successfully installed on our server. When a item is selected from one drop down list, it causes a postback then when the page is refreshed the drop down list resets itself to the default value. This only seems to occur when there is a web part connection on the page. Have you got any ideas/solution to this problem?

    ReplyDelete
  58. This is GREAT!

    Would be nice if the drop-downs would sort (ie alphabetically). It almost beats the purpose of having them cascade if everything shows up all shuffled up.

    also, it seems that the columns must be named "title" otherwise it doesn't work. Or at least it wouldn't work for me, I would get a Sharepoint error.

    ReplyDelete
  59. Hi Sarith,
    I can't seem to get it to work on my norwegian site, when I allow multiple values on the child column. It works fine if you can only select one parent and one child. But with multiple values I get the error:
    "Error in function:
    SPServices.SPCascadeDropDowns
    Parameter:
    childColumn: By
    Message:
    Column not found on page"
    I tried following the same procedure on an english site, and it worked fine, with multiple values and all. The only difference seems to be the language.

    Please help! :)

    Jasmine

    ReplyDelete
  60. the Columns don't show up at all in the data views (the ones that area like Excel)...

    ReplyDelete
  61. Hi, thanks for the solution, its great !!!
    I have a question about the location of the ASCX files. in your VS solution, the ASCX controls are at the root of CONTROLTEMPLATES sharepoint folder. But I need to use another pattern, i would like to place the ASCX files on the path CONTROLTEMPLATES\MyApp. I made the changes that let me create the field in a list but when I try to create an item I receive an error message (object not set to an instance). I think the problem is in CascadingDropDownListFieldControlWithFilter.cs in the function CreateChildControls().... the statement TemplateContainer.FindControl("CascadingDropDownList") return null...

    Can you help me ?

    Thanks again
    Mick

    ReplyDelete
  62. Hi can you please help me with this:

    i am trying to update the parent field value from the list. it throws the following error:

    "Field type parent dropdown list is not installed properly.go to the list and delete the field"

    ReplyDelete
  63. How would you do this if you cannot post files to the server?

    ReplyDelete
  64. Jasmine said...

    Hi Sarith,
    I can't seem to get it to work on my norwegian site, when I allow multiple values on the child column. It works fine if you can only select one parent and one child. But with multiple values I get the error:
    "Error in function:
    SPServices.SPCascadeDropDowns
    Parameter:
    childColumn: By
    Message:
    Column not found on page"
    I tried following the same procedure on an english site, and it worked fine, with multiple values and all. The only difference seems to be the language.


    Solution:
    In the code replace "selected value" and "possible value" with the equivalent for your language. You can find the title by using Firebug or Developer Tools. The solution is on codeplex: http://spservices.codeplex.com/Thread/View.aspx?ThreadId=85478

    ReplyDelete
  65. Regarding MS Office DIP's you can edit the DIP in MS InfoPath (DIPs are simply InfoPath forms).

    Edit the DIP via document library content types in SharePoint, delete the text boxes SharePoint interprets these custom fields as and add dropdown field controls. Bind them using the lists as the data source and filter to provide the cascading effect.

    Hope this assists someone.

    I also have code to install/use these CDDLs as site columns but don't have it available at the second.

    ReplyDelete
  66. Thank you so much for this tutorial.

    Worked perfectly for me.

    ReplyDelete
  67. I ve tried this scenario but it retrives values for only continenet and country,when i open drop down list of city ,its empty

    ReplyDelete
  68. Hi Sarith,
    This is a great web part, but with one problem that prevents me using it on the live site; it does not support the datasheet view.

    I use the datasheet view extensively to quickly tag large amounts of documents at a time. Even if you cannot change the value through typing or a dropdown, it would be great to be able to copy and paste an exhisting value (like the checkbox).

    Probably something to be added to the wish-list.

    ReplyDelete
  69. This looks really great.
    A few things to note:-
    1. Guys, this is NOT a web part so pls don't mention web part anywhere. It is a Field Type...lol
    2. The source code has a "Feature" but it is technically a useless "Feature" since there is nothing in it :). I think it's kind of left-over from the old code. Just remove it before you build a new wsp package.
    3. As someone has mentioned, it uses TEXT field to map and display both. If you are maintaining the parent-child relationhip using ID and ParentID columns then you are in trouble...:) This is because if you use the ID as the "Column for value" and Title as "Column for Text" then also the value displayed/stored will be ID and not Title.

    ReplyDelete
  70. Hi,

    I'm not able install it for SHarepoint 2010...can u help me pls!

    ReplyDelete
  71. This list is also supposed to implement filters on the lookup fields.
    The problem I am facing is that I can't apply dynamic filters to it. e.g. Created By = [Me]
    It gives me an unexpected error. Can you tell me how to go about this.

    Thanks in advance.

    Huzefa Mala.

    ReplyDelete
  72. Hi. I dont Know Why I have This Silly problem. I have Configed the column like you described but the column "continent" show no data, it seems that it cannot connect to the source list.
    help me in this case please
    thanxxx

    ReplyDelete
  73. Its really helpful, but I also have one issue..

    Its working when i take ID for both value and text field but if I take Title or any text Field
    It stop binding

    please suggest me if any solution is exist...
    Thanks!

    ReplyDelete
  74. Anyone know if it is possible to preserve the linked nature of a lookup field. For example within a MyLocation list Item, can you have the Country field be linked to that item in the Country list? As it is now it only appears as text. Thanks

    ReplyDelete
  75. Hi!
    Great work, but I'm having trouble with the control and the field names in spanish. For example, if I try to use field "Título" (title) I've got the generic sharepoint error message. Is there a fix for this? Also, are there an spanish translation?
    thanks!

    ReplyDelete
  76. Hi Sarith,

    Issue is whenever i am trying to add a new cascaded lookup column in documnet library(through setting options), or clicking on an existing one recieving the below error message:

    An entry with the same key already exists. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)
    at KWizCom.SharePoint.FeildControls.DualLookupType.DualLookupFeildEditor.CreateChildControl()
    at System.Web.UI.Control.EnsureChildControlls()
    at KWizCom.SharePoint.FeildControls.DualLookupType.DualLookupFeildEditor.InitializeWithFeild(SPFeild feild)
    at Microsoft.SharePoint.ApplicationPages.FeildCustomizationPages.OnLoad(EvenArgs e)
    at Microsoft.SharePoint.ApplicationPages.FeildEditPage.OnLoad(EvenArgs e)
    at System.Web.UI.Control.LoadRecursive()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includesStagesBeforeAsyncPoint, Boolean includesStagesAfterAsyncPoint.

    Please let me know if you have any sulution for this...it would be great if you would help me out.

    Thanks in Advance.
    Mouenn

    ReplyDelete
  77. Hi,

    If you have Date and Time required field on the list form then this cascading dropdown does not work if we don't fill Date and Time first. When we select the dropdown field it does not fill the 2nd dropdown untill we have value in Date and Time field.

    Has anybody else faced the same problem? Any work around for this?

    Thanks,
    San

    ReplyDelete
  78. Hi,

    Has anyone attempted to install this on SharePoint 2010 Foundation/Server? I've made an attempt and got as far as being able to see the selection for CDDL when I create a new column but when I select the radial button to indicate that field type it spits out this error:

    Error
    Could not load the assembly 'Stoneshare.CascadingDropDown.WithFilter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=14d22e157966c24d'. Make sure that it is compiled before accessing the page.

    Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID: 6fdf773c-bb03-45ab-9d05-5b6242e0580a

    Has anyone investigated this further or been able to get this working with SharePoint 2010 with a workaround? Or am I missing a configuration step somewhere. I have reset the server after deployment and that made the field type show up as an option but that's as far as I've made it. It may be worth noting that it failed a PowerShell SPSolution GAC Deployment saying it wasn't scoped for web application install so I deployed it with Visual Studio 2010 and it deployed successfully. I'll post back if I get it working.

    Environment:
    Windows Server 2008 R2
    SQL Server 2008 R2
    SharePoint 2010 Server

    Cheers,
    Lael

    ReplyDelete
  79. Sarith, I love your column type solution, but I am having an issue with it. If I try to use a column that was renamed from Title to, say Name for example, I get "an unexpected error has occurred". Has there been any way to work around this yet?

    ReplyDelete
  80. Oh and it also seems to be happening on "Person or Group" type columns as well.

    ReplyDelete
  81. I get Unknown error while clicking the cascading drop down option in the list

    I have downloaded the code and modified the project name according to company standard. I build the solution and deployed it.

    However I get Unknown error occured while clicking the option

    Early reply is much appriciated

    ReplyDelete
  82. Hello,

    I have a doubt, I insttaled in one server with Sarepoint WSS 3.0 in Portuguese. The soluction install ok, but after I create all lists include MYLocation, I don't work I receive a Error Page. Do you have idea if I need change any thing to work in portuguese Brazil?

    Thanks

    ReplyDelete
  83. Nice control. Is there a way to allow multiple values for this control like in the lookup column of SharePoint?

    Thanks.

    aMo

    ReplyDelete
  84. hye sarith,

    my name is lynx.. i have a question about this stoneshare casacading.

    i need to re-arrange the column that i've made. i follow exactly the way how i create the previous column structure..
    but when i try to filter the 3 column by 2 column it gives me an unexpected error occured.. i wonder why does it happen because i follow exactly what i did on my previous column structure..
    please help me as i already tried so many methods and i couldnt think of one more..


    p/s : how can i cantact you personally? any emails?


    thank you..

    ReplyDelete
  85. It seems that I get a looping error when I reference a content type field. Is there a way around this?

    ReplyDelete
  86. Hi.

    I did the examples indicated and works perfectly well.
    I tested with other lists of SharePoint and work correctly also.
    Finally i try with my external lists of SQL and it marks an error to me, Correlation ID: aaf526eb-5b91-4f1f-b283-bfa052302dea.

    Somebody could solve this error?

    Regard

    ReplyDelete
  87. Hi Sarith,

    Your sollution support Sharepoint Foundation 2010?

    ReplyDelete
  88. Hi everyone,

    Thank you all for your comments and reviews. My apologies for the prolonged absence. I've been on the go for about a year now, and have lost all access to my dev environment. It appears that I will have to rebuild my dev environment from scratch.

    Should hopefully be up and running by the end of the week. If you have any issues that required a fix, please post them on the codeplex page. Once I've managed to get a decent setup, I'll try and answer all the comments posted here.


    Thanks,
    Sarith

    ReplyDelete
  89. Hi,

    I have the 3 dropdwons working on my client's intranet. Is there a way to get the dropdown choices to filter a Sharepoint list of results on the same page?

    I can't install webparts, unfortunately.

    Regards
    Ian Smith

    ReplyDelete
  90. Is there support for MOSS 2010 planned ?

    ReplyDelete
  91. Hi,
    I installed and used the solution given by you. But i have one issue of which is the cascading loading time for 3 lists taken too long for the page to refresh.

    Do you have any solutions for the page to refresh?

    ReplyDelete
  92. Great tool, does anyone know if there is away to do something similar to this using a Document Library?

    ReplyDelete
  93. I set up the lists and configured the columns as in your blog examplein WSS 3.0, but I still get the "unknown error" when I try to add or edit list items. It starts happening as soon as I add the second cascading field so the list. (I tested it one step at a time to find the error.) I also added this comment to the discussion on Codeplex. I would love to know if anyone has found a solution for this. Thanks, Ronnie

    ReplyDelete
  94. Hi Sarith,

    Great work first of all :)

    My question is: Is there any way to change "please select an item" default field? My native is not English so i have to change it.

    Regards,
    Qzoo

    ReplyDelete
  95. How do I add the custom field for cascading drop down list (with filter)? Sorry i'm very new to this!

    ReplyDelete
  96. Heya,

    I'm having problems with the setup and would like some help. It says that SharePoint was unable to connect to the database server. Are there any known common problems that anyone is encountering? Anything I should check?

    Thanks,
    Ian

    ReplyDelete
  97. Check that the SQL server is running. :)

    ReplyDelete
  98. In your screenshots, why are there duplicate columns in the Countries and Cities lists? i.e. Title column plus Country, Title plus City?

    I simply created the Countries list with Title and Continent (lookup); and the Cities with Title and Country (lookup). Everything works as expected.

    Also curious if there's a way to filter duplicate fields from the dropdowns. e.g. Title and Name.

    ReplyDelete
  99. Final question - promise! :)

    Wondering if there's any easy way to prevent the auto postback for the final dropdown. Seems redundant because the parent/parent gets cleared on change. Or am I wrong?

    ReplyDelete
  100. Has anyone had any problems after migrating a list that uses this feature to SharePoint 2010? This works great in 2007 and I was able to install and deploy the feature to 2010, but then after migrating the list to SP 2010 environent the existing cascading fields are unaccessible, I get a generic error from SharePoint if I try to add a new item to this list or try to edit the columns. I can create new cascading columns and remove the pre-exisiting ones and then the list works, but problem is that I just lost any information that was in those pre-existing columns. Any ideas? Anyone else tried migrating a list using this feature to 2010 yet?

    ReplyDelete
    Replies
    1. A little bit late, but, you only have to change the path in your SharePoint 2007 site, for example:
      http://server_name/site/list/etc... instead try with this path, a relative one //site/list/etc.. Then, when you do the migration of you site or web app, there will be no problem at all because the feature wont search the server's name, just the location in that server, the error appears when the path is an absolute one. I hope it works for you.

      Delete
  101. Hey Sarith,

    I'm hoping you still check this blog! I just implemented the cascading solution (works so far, but I'm stuck) in terms of making it work beyond what i want

    I have a simple CRM (Company List), Contact List (that has Company Lookup) and a separate site with another list for Machine Tools

    Now, Machine Tools has Company which allows you to pull in a Contact, I now want to pre-populate a mobile number based on the contact I select.

    When I try a Cascading dropdown, it comes up blank...any thoughts?

    Thanks so much for your help!

    ReplyDelete
  102. This worked great for two drop downs (parent child)....now, when I try to add a grand parent drop down I get an unknown error tryin ot add or edit a new item. I go back and delete the linking between the gran parent and parent and the error goes away however, the cascade from gran parent to parent is not linked. Any ideas?

    ReplyDelete
    Replies
    1. You have to do the relations in order, so the first one has to be the grand parent field, then the parent and so on, if you did backwards that's why you get the error. then if you want the fields arrange different for your form, yo just change them in the edit "view" of the list, but always, when trying to create and configure your fields in the list, do it in order, then change it and you will not have any errors at all. Good luck

      Delete
  103. Hi Everyone,

    My apologies for my extended absence. I've been completely out-of-sync with this project working on other things, and it will take me some time to come up to speed with all the discussions happening on this project.

    I realize this is outdated code and would need to be made compatible with the latest version of SharePoint. If anyone has tested code that is available, please connect with me and I can have the code uploaded as part of this project.


    Thanks,
    Sarith

    ReplyDelete
  104. Hi Everyone,

    I've rewritten the webpart and it worked in Sharepoint 2010.

    ReplyDelete
    Replies
    1. I would be interested in the code also, as I am not seeing the cascaede drop down type when creating a new column.

      Delete
    2. Does anyone have this updated code please?

      I have also deployed the old code in sharepoint 2010 and the cascade drop down type isnt there when creating a new column

      Delete
  105. hi good day,

    I install and implement the solution in the central administration,but when I look for the solution in feactures of my web application, but I do not find the solution in feactures site to activate I can user it in my site, What can I do? what it error I have?

    ReplyDelete
  106. Hi Adriano,
    There won't be a feature to activate this. The cascaded drop down column type will be directly available in your list.

    ReplyDelete
  107. Hi Sarith,
    The column names you have mentioned in the list MyCountry are different from column names in your fourth list. Also can you publish column types of the three earlier lists for better explaination. Currently ,when I join the parent from child the child column remains blank

    ReplyDelete
  108. Hi Sarith, I have folloowed all the steps precisely as described including restarting IIS and rebooting the server, but i am still unable to see the cascaded drop down column typ in my list when I try to create a new column. I have deployed it at the top level so it should be usable throughout, but i cannot find it anywhere when I try to create a new column like this.

    ReplyDelete
  109. Hi

    Can anyone provide the update code for this to work in Sharepoint 2010 please?

    ReplyDelete
  110. Hi,The key elements to a good Web Design Cochin are visual appeal, good clear navigation and good attention to usability.Thanks...........

    ReplyDelete
  111. Hi Sarith

    This is in regard to the codeplex solution http://cascddlistwithfilter.codeplex.com/

    Create a site "site1" --> Custom list "list1" --> col "parent drop down" "col1" --> save site as template --> create new site with that template --> col1 under list1 is not reconfigurable to some other url . Load lists button would again retype the same old url in the old site.

    Please guide, the portal using this solution is in Production and affects business.

    TIA

    ReplyDelete
  112. Lookup Plus for SharePoint 2013, It is more than Sharepoint Lookup. Cascaded Lookup, Filtered lookup, Cross-site Lookup /drop down/ and
    some controls are free. ("Create new item" link) Visit, http://www.azu.mn
    Or watch the channel http://www.youtube.com/watch?v=70-hXWY6ARY&list=PL-5v3e65O1cFMddgCpzIURE_UAsL-oDdW

    ReplyDelete
  113. Hello,
    How to change the sorting column of drop-down content? By the default the sorting column is ID, can I change the sorting column to other column where click dropdown content?

    Gary.

    ReplyDelete
  114. The images are no longer showing for this article

    ReplyDelete
  115. Instead of entering a value in the Value to Filter field, is there any way to feed in the value from another field?

    ReplyDelete