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
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
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.
Prangadj
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.
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.
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
I have created a blank site and added this web part to it. Which code you want me to send?
Prangadj
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.