Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPGridView filter in list data source

$
0
0

Hi,

I have used SharePoint grid view to display list data with filtering. Grid displays the filter values in header column, but when i selected the filtered data it throws the below exception message.

System.InvalidOperationException: ERROR: The data source does not contain a property with the name specified by the FilteredDataSourcePropertyName property: FilterExpression   at Microsoft.SharePoint.WebControls.SPGridView.DoFilterPostBackEventProcessing(String filterData)    at Microsoft.SharePoint.WebControls.SPGridView.RaisePostBackEvent(String eventArgument)    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

SPGridView source

<SharePoint:SPGridView ID="SPRefDocGrid" runat="server" AutoGenerateColumns="False"
                        DataSourceID="_source" AllowPaging="True" AllowSorting="True" AllowFiltering="true" FilteredDataSourcePropertyName="FilterExpression"
                        FilterDataFields=",Spec_x0020_No" FilteredDataSourcePropertyFormat = "{1} = '{0}'" OnSelectedIndexChanged="SPRefDocGrid_SelectedIndexChanged"
                        CellPadding="4" EnableModelValidation="True" ForeColor="#333333" GridLines="None"><AlternatingRowStyle BackColor="White" /><Columns><asp:CommandField ButtonType="Link" SelectText="Select" ShowSelectButton="true" /><SharePoint:SPBoundField DataField="Spec_x0020_No" HeaderText="Spec No" SortExpression="Spec_x0020_No" /><SharePoint:SPBoundField DataField="ECN_x0020_NO" HeaderText="ECN NO" SortExpression="ECN_x0020_NO" /><SharePoint:SPBoundField DataField="Spec_x0020_Title" HeaderText="Spec Title" /><SharePoint:SPBoundField DataField="Processes_x0020_Classification" HeaderText="Process Code" /><SharePoint:SPBoundField DataField="EditorName" HeaderText="EditorName" /><SharePoint:SPBoundField DataField="Department" HeaderText="Department" /></Columns><EmptyDataTemplate>
                            Empty Data</EmptyDataTemplate>                                                <PagerSettings Mode="NextPreviousFirstLast" Visible="true" NextPageText="Next |"
                            PreviousPageText="Previous |" FirstPageText="First |" LastPageText="Last" />                                                                       </SharePoint:SPGridView><SharePoint:SPDataSource ID="_source" runat="server" DataSourceMode="List" SelectCommand="<Query><Where><Eq><FieldRef Name='Spec_x0020_Status' /><Value Type='Text'>Released</Value></Eq></Where></Query>"
                        UseInternalName="true"><SelectParameters><asp:Parameter Name="WebUrl" DefaultValue="/SubSite1/" /><asp:Parameter Name="ListName" DefaultValue="ListName1" /></SelectParameters></SharePoint:SPDataSource>

Anandhan.S Remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>