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

Throwing javascript error "RadGrid for SharePoint 2010"

11 Answers 91 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
vinitha
Top achievements
Rank 1
vinitha asked on 19 Jul 2010, 05:33 PM
Hi All,

I am getting javascript error "object doesnt support this property or method" when I am trying to show RadGrid in SharePoint 2010 site.
 
Given below are the steps followed.
1. Created a web part which binds sample data to the RadGrid in CreateChildControls() overriden method.
2. Deployed the web part in SharePoint server.
3. Added the web part to the web part gallery.
 
Now when trying to add the web part in the page, it throws javascript error. Debugging the error found that this is thrown from Sys.Application.add_init()
{
$create(Telerik.Web.UI.RadGrid,........)
}
 
Can you please help me out in resolving this?

Note: Telerik.Web.UI version is 2008 and SharePoint 2010 Beta version.

Thanks in advance.

11 Answers, 1 is accepted

Sort by
0
Prangadj
Top achievements
Rank 1
answered on 20 Jul 2010, 08:18 AM
vinitha, is there some javascript hooked to grid that may not be run properly - client events or other? This error may be because of that.

Also I know that Sharepoint 2010 is already official and RadControls for AJAX current version is 2010.2.713. If you follow release notes, u know Telerik have Sp 2010 web parts for grid and editor.

Prangadj
0
vinitha
Top achievements
Rank 1
answered on 20 Jul 2010, 08:42 AM
Hi,

Thanks for the response.

No client side events. Here is the code that i have put in the webpart.

RadGrid radGrid1;

protected override void CreateChildControls()
        {
            base.CreateChildControls();

            radGrid1 = new RadGrid();
            radGrid1.DataSource = GetData();
            radGrid1.DataBind();
            this.Controls.Add(radGrid1);
           
        }

        private DataTable GetData()
        {
          DataTable dt = new DataTable("Employee");
          dt.Columns.Add("Id");
          dt.Columns.Add("FirstName");
          dt.Columns.Add("LastName");

          for (int i = 1; i <= 10; i++)
          {
            DataRow dr = dt.NewRow();
            dr["Id"] = i.ToString();
            dr["FirstName"] = "XXXX" + i.ToString();
            dr["LastName"] = "YYYYY" + i.ToString();
            dt.Rows.Add(dr);
          }

          return dt;
        }

}

Deployed the web part. When i try to add the web part to the page, it throws javascript error "Object doesnt support this method or property"

Please do help me in resolving this.

Thanks in advance.
0
Prangadj
Top achievements
Rank 1
answered on 20 Jul 2010, 09:06 AM
Do you get same error when you put Microsoft GridView instead of RadGrid? Also test with official Sharepoint 2010.

Prangadj
0
vinitha
Top achievements
Rank 1
answered on 20 Jul 2010, 10:07 AM
Hi,

I dont get any error when i use <asp:GridView> control. I dont have the official version with me right now. So cant try on it. Can someone verify whether this issue exists in SharePoint 2010 Beta version?

Thanks in advance.

0
vinitha
Top achievements
Rank 1
answered on 20 Jul 2010, 12:58 PM
Hi,

Verified the same in official SharePoint 2010 version. I see the same error "Object doesnt support this method or property".

Can someone verify this and let me know as how to resolve this?

Thanks in advance.
0
Prangadj
Top achievements
Rank 1
answered on 20 Jul 2010, 01:41 PM
What happens if you set id for the dynamic grid as so:

protected override void CreateChildControls()
        {
            base.CreateChildControls();
  
            radGrid1 = new RadGrid();
            radGrid1.ID = "radGrid1";
            radGrid1.DataSource = GetData();
            radGrid1.DataBind();
            this.Controls.Add(radGrid1);
              
        }
  
        private DataTable GetData()
        {
          DataTable dt = new DataTable("Employee");
          dt.Columns.Add("Id");
          dt.Columns.Add("FirstName");
          dt.Columns.Add("LastName");
  
          for (int i = 1; i <= 10; i++)
          {
            DataRow dr = dt.NewRow();
            dr["Id"] = i.ToString();
            dr["FirstName"] = "XXXX" + i.ToString();
            dr["LastName"] = "YYYYY" + i.ToString();
            dt.Rows.Add(dr);
          }
  
          return dt;
        }
  
}

If it's the same, post the code from the page where you add the web part for more research.

Prangadj
0
vinitha
Top achievements
Rank 1
answered on 21 Jul 2010, 05:03 AM
I tried setting "Id" for the dynamically added RadGrid as per your suggestion. But no luck. I still get the error.

I have created a blank site and added this web part to it. Which code you want me to send?
0
Prangadj
Top achievements
Rank 1
answered on 21 Jul 2010, 09:18 AM
Show me html/codebehind source of the page where you add the webpart. Also show me what you see from the FireBug console when this page loads (attach screen capture).

Prangadj
0
vinitha
Top achievements
Rank 1
answered on 21 Jul 2010, 12:11 PM
I am unable to send the view source as we can only attach .jpg, .jpeg and so on. Unable to send the screen shot as its exceeding the limit. Any other source of sending the details?
0
vinitha
Top achievements
Rank 1
answered on 21 Jul 2010, 01:32 PM
I am unable to send the view source as we can only attach .jpg, .jpeg and so on. Unable to send the screen shot as its exceeding the limit. Any other source of sending the details?
0
vinitha
Top achievements
Rank 1
answered on 22 Jul 2010, 11:56 AM
Hi All,

Issue got resolved by using Telerik 2010 version dlls. But i am facing a different issue now.

OnSelectedIndexChanged event is getting fired only once after the page is loaded. Can someone help me out in this?

Thanks in advance.
Tags
Sharepoint Integration
Asked by
vinitha
Top achievements
Rank 1
Answers by
Prangadj
Top achievements
Rank 1
vinitha
Top achievements
Rank 1
Share this question
or