0

Version : SharePoint 2010

I am getting below error while i click any of the filter dropdown in my SPGridView implemented.

enter image description here

Below is my markup and code implemented so far.

ASPX

<SharePoint:MenuTemplate ID="_menu" runat="server" > 
    <SharePoint:MenuItemTemplate ID="DeleteItemMenuItemTemplate" 
                                     Text="Delete" 
                                     ImageUrl="~/_layouts/IMAGES/DELITEM.GIF"
                                     runat="server">
        </SharePoint:MenuItemTemplate>
</SharePoint:MenuTemplate> 

<SharePoint:SPGridView runat="server" ID="spGridTest" AllowFiltering="true" AllowSorting="true" AutoGenerateColumns="false"
    AllowPaging="true" PagerSettings-Mode="NextPrevious" FilterDataFields="Title,,Modified,Editor,Status" FilteredDataSourcePropertyName="Where" 
                           FilteredDataSourcePropertyFormat='{1}="{0}"'>

    <Columns>
       <SharePoint:SPMenuField HeaderText="Nombre" TextFields="Title" MenuTemplateId="_menu" 
            NavigateUrlFields="ID,Title" 
            NavigateUrlFormat="do.aspx?ID={0}&Name={1}" 
            TokenNameAndValueFields="EDIT=ID,NAME=Title" 
            /> 

        <SharePoint:SPBoundField HeaderText="Meeting Date" DataField="eSCRIBE_x0020_Meeting_x0020_Date" />
        <SharePoint:SPBoundField HeaderText="Modified Date" DataField="Modified" />
        <SharePoint:SPBoundField HeaderText="Modified By" DataField="Editor" />
        <SharePoint:SPBoundField HeaderText="Status" DataField="Status" />
    </Columns>



</SharePoint:SPGridView>

C#

protected void Page_Load(object sender, EventArgs e)
        {

            IsFilterOnlyRequest();
            if (!Page.IsPostBack)
            {

                BindGridData();
            }
        }
        private bool IsFilterOnlyRequest()
        {

            //If it is a callback from Filter Menu on SPgrid than

            //Extract the name of the col. the grid is being filtered on

            if (Page.IsCallback && !string.IsNullOrEmpty(Request.Form["__CALLBACKPARAM"]))
            {

                //Request.Form[“__CALLBACKPARAM”] will have a format of “_SPGridView_;Col Name”
                string[] param = Request.Form["__CALLBACKPARAM"].Split(";".ToCharArray());

                if (param != null)
                {

                    return true;
                }

            }


            return false;

        }
        private void BindGridData()
        {
            using (SPSite site = new SPSite(SPContext.Current.Web.Url))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists.TryGetList("Reports");
                    if (list != null)
                    {
                        SPListItemCollection itemColl = list.GetItems();
                        if (itemColl != null && itemColl.Count > 0)
                        {
                            spGridTest.DataSource = itemColl.GetDataTable();
                            spGridTest.DataBind();
                        }
                    }
                }
            }
        }

Kindly help

  • Your error image is not of good quality. Can you enlarge it and re post? Also a brief description on what you tried till now will be helpful. – Asad Refai Jun 9 '17 at 7:10
  • i have changed the image.. and the code is all i have tried so far. – Vishwas Goswami Jun 9 '17 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.