Description

How’d we know what people want – folder, inside folder, or just items? SPDataSource has an “affected scope”. It can be one of the follow:

  • Default, Show only the files and subfolders of a specific folder
  • Recursive, Show all files of all folders
  • RecursiveAll, Show all files and all subfolders of all folders

All enumeration values are covered all possible developer’s intentions. Other words, without specified, SharePoint will use Default value. It is not always correspond develepers needs now or later espetially in case of new folder added. Notify about missing Scope we give developer change to specify it’s architecture approach.


sharepoint:spdatasource runat="server" id="dsPeople" datasourcemode="ListItem" useinternalname="true">
 <selectparameters>
   <asp:parameter name="WebUrl" defaultvalue="/configuration/"></asp:parameter>
   <asp:parameter name="ListID" defaultvalue="34F91B0C-FCF2-455A-ABBA-67724FB4024A"></asp:parameter>
   <asp:parameter name="ListItemID" defaultvalue="1"></asp:parameter>
 </selectparameters>
/sharepoint:spdatasource>

asp:gridview id="grdPeople" runat="server" datasourceid="dsPeople" autogeneratecolumns="False">
 <columns>
   <asp:boundfield datafield="FullName" headertext="Blogger name"></asp:boundfield>
   <asp:boundfield datafield="WorkCity" headertext="City"></asp:boundfield>
   <asp:boundfield datafield="Blog_x0020_URL" headertext="Blog URL"></asp:boundfield>
 </columns>
/asp:gridview>


Resolution

Specify Scope property.

Links