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

RadGrid Filtering Problem

3 Answers 135 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos Valdez
Top achievements
Rank 1
Carlos Valdez asked on 28 May 2010, 04:52 PM
Hi, 

    When i select a filter in the RadGrid send me an error here:

        Telerik.Web.UI.GridTableView.registerClass(

"Telerik.Web.UI.GridTableView",Sys.UI.Control);

 

        Telerik.Web.UI.GridFilterFunction=

function(){};

 

        Telerik.Web.UI.GridFilterFunction.prototype= {NoFilter:0,Contains:1,DoesNotContain:2,StartsWith:3,EndsWith:4,EqualTo:5,NotEqualTo:6,GreaterThan:7,LessThan:8,GreaterThanOrEqualTo:9,LessThanOrEqualTo:10,Between:11,NotBetween:12,IsEmpty:13,NotIsEmpty:14,IsNull:15,NotIsNull:16,Custom:17};

        Telerik.Web.UI.GridFilterFunction.registerEnum(

"Telerik.Web.UI.GridFilterFunction",false);

 

        Telerik.Web.UI.GridFilterFunction.parse=

function(b,a){return(typeof b=="number")?b:Sys$Enum$parse.call(this,b,!!a);

    Sys$Enum$parse is not defined

thank you for your help.

 

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 31 May 2010, 01:24 PM
Hello Carlos,

I suspect that you are using RadControls in .net 4.0 as target framework with ToolkitScriptManager from 4.0 branch of AjaxToolkit controls. If this is the case you can try latest version of RadControls for ASP.NET AJAX where this issue has been resolved.

Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
nguyen
Top achievements
Rank 1
answered on 01 Jun 2011, 03:55 AM
Hi Nikolay,
I've proplem same as Calos Valdez about filter in RadGrid. I using lastest version RadControls and working .net 3.5.
I run demo project then it still working. But I add my project then doesnt not work and generate script error:
Sys$Enum$parse is not defined
.....
Telerik.Web.UI.GridFilterFunction.registerEnum("Telerik.Web.UI.GridFilterFunction",false);
Telerik.Web.UI.GridFilterFunction.parse=function(b,a){return(typeof b=="number")?b:Sys$Enum$parse.call(this,b,!!a);
...

I've add ScripManager in Master Page
In file xxx.aspx I've add RadAjaxManager

This is in file xxx.aspx:

  public void InstantiateIn(Control container)
        {
RadGrid radGrid = new RadGrid();
            radGrid.ID = name + "rda";
            radGrid.AllowFilteringByColumn = true;
            radGrid.AllowSorting = true;
            radGrid.GroupingSettings.CaseSensitive = false;
            radGrid.ClientSettings.EnableRowHoverStyle = true;
            radGrid.NeedDataSource += new GridNeedDataSourceEventHandler(radGrid_NeedDataSource);
            radGrid.PreRender += new EventHandler(radGrid_PreRender);
            //---
            radGrid.MasterTableView.AutoGenerateColumns = false;
            radGrid.MasterTableView.Columns.Clear();
           foreach (Column col in columns)
            {
                //columnNameNoLang = col.Name.Replace("@LANG", basePage.Lang);
                GridBoundColumn templateColumn = new GridBoundColumn();
                templateColumn.DataField = col.Name;
                switch (basePage.Lang)
                {
                 
                    case "en":
                        templateColumn.HeaderText = col.Caption_en;
                        break;
                   case "it":
                        templateColumn.HeaderText = col.Caption_it;
                        break;
                    default:
                        templateColumn.HeaderText = col.Caption_en;
                        break;
                }
                templateColumn.Visible = col.Visible;
                templateColumn.AllowFiltering = true;
                templateColumn.ShowFilterIcon = false;
                templateColumn.AutoPostBackOnFilter = true;
                
                templateColumn.CurrentFilterFunction = GridKnownFunction.Contains;
                radGrid.MasterTableView.Columns.Add(templateColumn);
                radGrid.ClientSettings.ClientEvents.OnRowSelected = "RowSelected_" + name;
                radGrid.ClientSettings.Selecting.AllowRowSelect = true;
            }
            container.Controls.Add(radGrid);
}
void radGrid_PreRender(object sender, EventArgs e)
        {
            RadGrid grid = sender as RadGrid;
            grid.MasterTableView.AutoGenerateColumns = false;
        }
        void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid grid = source as RadGrid;
            DataTable dt = CaseDal.GetDatafromQueryString(datasource);
            grid.DataSource = dt;
        }

 I hope that you recomment and fixed about error for me.

Thanks.



0
Iana Tsolova
Telerik team
answered on 06 Jun 2011, 07:52 AM
Hi nguyen,

Try creating the grid on Page_init in the xxx.aspx page as described below and see if it makes any difference:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html

Regards,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Carlos Valdez
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
nguyen
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or