This is a migrated thread and some comments may be shown as answers.

RadGrid Custom Filter Issue

1 Answer 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mahesh Babu
Top achievements
Rank 1
Mahesh Babu asked on 05 Aug 2009, 05:05 AM
Hi,

I have a radGrid to which I am assigning custom filter menu at runtime as given below. When I click on filter menu, I am getting the following error. Any suggestions please.

Error

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 30 Jul 2009 13:49:43 UTC


Message: Sys.WebForms.PageRequestManagerServerErrorException:  is neither a DataColumn nor a DataRelation for table Table.
Line: 6
Char: 62099
Code: 0
URI: http://localhost:1168/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.701.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad5b69bca-cfa7-4e0a-9dd0-824ae4c4ef5a%3a16e4e7cd%3af7645509%3a24ee1bba%3a19620875%3a874f8ea2%3a33108d14%3abd8f85e4%3a86526ba7%3aed16cbdc%3a1e771326%3aaa288e2d%3a58366029%3ae330518b%3ac8618e41%3ae4f8f289

 

Default.aspx

<telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="false" AllowPaging="true"
                AllowSorting="true" AllowCustomPaging="true" PageSize="5" AllowFilteringByColumn="false"
                OnPageIndexChanged="radGrid_PageIndexChanged" OnPageSizeChanged="radGrid_PageSizeChanged"
                OnSortCommand="radGrid_SortCommand" OnItemCommand="radGrid_ItemCommand">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
                <FilterMenu OnItemClick="FilterMenu_ItemClick"></FilterMenu>
                <ClientSettings Scrolling-AllowScroll="false">
                    <ClientEvents OnColumnContextMenu="ColumnContextMenu" />
                </ClientSettings>
            </telerik:RadGrid>
          
Default.aspx.cs

public void AddCustomGridFilters()
        {
            radGrid.FilterMenu.Items.Clear();
            GridFilterMenu filterMenu = radGrid.FilterMenu;

            RadMenuItem[] radMenuItems = new RadMenuItem[7];
            for (int index = 0; index < radMenuItems.Length; index++)
            {
                radMenuItems[index] = new RadMenuItem();
                radGrid.FilterMenu.Items.Add(radMenuItems[index]);
            }

            radMenuItems[0].Text = Constants.EqualTo;
            radMenuItems[1].Text = Constants.StartsWith;
            radMenuItems[2].Text = Constants.EndsWith;
            radMenuItems[3].Text = Constants.LessThan;
            radMenuItems[4].Text = Constants.GreaterThan;
            radMenuItems[5].Text = Constants.Contains;
            radMenuItems[6].Text = Constants.NoFilter;
        }


Thanks,
Mahesh

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 10 Aug 2009, 06:27 AM
Hi Mahesh,

With the newest version of the control, you can take advantage of the filter template, to customize the filter menu and its behavior. Additional information on this option is available in the following article:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

I hope this helps.

Kind regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Mahesh Babu
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or