none
BUG: Connected Web Parts are broken in SharePoint 2010 RRS feed

  • Question

  • Not sure where to report bugs (connect site seems dead and bugs entered in connect for most products tend to take years to get fixed), so I'm dropping it here:

    Just stumbled upon a bug in SharePoint 2010. Imagine this scenario: You have two lists and add them to a Site as DataForm WebParts. You then configure the Web Parts so that one of them sends Filter values to the other one and uncheck the option for "Send first row to connected Web Parts when page loads". You refresh the Page and notice that the list that receives the Filter (the Consumer) does not show any items because the list that provides the Filter (the Provider) does not have any items selected.

    In SharePoint 2007, not selecting an item in the Provider List would cause the consumer List to display all items instead, which was (at least for us) highly desirable. In SharePoint 2010, you have to select an Item in the Provider to provide a filter and there is no way to have the Consumer List display all items anymore.

    The reason why I think this is a bug is the result of an extended Debugging session that eventually led me to the class Microsoft.SharePoint.WebPartPages.DataFormWebPart and specifically it's method ApplyReceivedFilterData. I'm not going to paste the source of this class, but the culprit is this line: if (dictionary2[str] != null)

    This is supposed to only add Filters that have a value and skip the ones that are null. The problem is that dictionary2[str] is not null but DBNull, which then causes SharePoint 2010 to process the value anyway and generate a nasty <Query><Where><IsNull><FieldRef Name="FieldToReceiveFilter" /></IsNull></Where></Query> clause in the SelectCommand of the underlying DataSource.

    Unfortunately, DataFormWebPart.ApplyReceivedFilterData is not virtual, so sub-classing it does not seem to be an option. Not sure if there is a good workaround for this. I verified this behavior in both RTM and December 2010 Hotfixed versions of SharePoint 2010.

    Edit: Special Thanks to whoever made the XsltListViewWebPart sealed. For the February 2011 Hotfixes, can I recommend doing a Search/Replace and removing 'sealed' from each and every sealed class? Thanks!

    Edit2: Just checked the SharePoint 2007 DataFormWebPart.ApplyReceivedFilterData() in Reflector and lo and behold, they did check for DBNull in 2007:

            Label_0046:
               
    if (current[str] is DBNull)
               
    {
                   
    goto Label_006D;
                   
    // Note by myself: Label_006D is the call to MoveNext, aka. continue
               
    }

    Looking at this some more, it seems that it could be actually a BugFix that introduced a behavior change. In SharePoint 2007, if you select a Row it changes the URL to "&SelectedID=12". However, if the SelectedID was invalid and did not point at an item in the Provider list, the Consumer List would instead show all items. So I can see the desire to "fix" this by not showing all items anymore, but it is a behavior change after all, so I would REALLY like a way to get the SP 2007 Behavior back.

    Sunday, January 23, 2011 1:07 AM

All replies

  • Greetings and thank you for your post.  We have validated the behavior you’ve reported, noting the differences between SharePoint 2007 and SharePoint 2010.  We’ve also confirmed that the behavior you are seeing in SharePoint 2010 is currently by design.  If you are a premier customer, you can create a new case, to request what would in effect be, a Design Change Request.  Alternatively, you could visit the below link to see the various support options that are available to better meet your needs: http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone; If you are a MSDN / TechNet subscriber, you can also contact our support by using your free support incidents.

    I’ll also document your request regarding a desire for SharePoint 2010 to return to the behavior seen in SharePoint 2007, in our internal Office database.

     

    Thanks for posting ! 

     

    Manas

    Friday, February 4, 2011 9:10 AM
  • Uh so Manas, how would you clear the filter per the scenario defined above?  We have the same problem.  We would like to use a list of department employees to filter a much larger list in another list.  The lists are connected from within SPD 2010.  Please help.  I cannot find a way of clearing this filter.  Its something so small and yet I am spending an inordinate amount of time on the problem.

     

    Drew


    Drew Selman Senior Manager - ESI, Inc.
    Wednesday, June 22, 2011 6:36 PM
  • We also had the same issue and it simply caused us to abandand the page and force the users to use another solution to our problem.

    Berney

    Monday, September 19, 2011 4:47 PM