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

[Solved] RadControlsAjaxCourseWare.pdf - Grid Client Side DataBinding

4 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Jan 2009, 03:17 PM
Hello,

I am attempting to evaluate the Telerik suite for purchase.  I am currently going through the RadControl for ASP.net ajax courseware .pdf. (794 Pages).   I am trying to get client side databinding to work for the grid.  I am using the tutorial on page 501 titled client side databinding.

I went through the tutorial and I also simply ran the packaged code of the very same tutorial and I am getting the same error in both my application and the example that was distributed with the tutorial.

I am getting the following error:  'Null" is null or not an object.

This error happens when the following line of code is called from within the javascript function updateGrid(result)

error happens here ---> tableView.set_dataSource(result);

when I break into the c# code, my customer objects are getting populated and when I check what "result" is in the javascript updateGrid() function just before calling the set_dataSource(result) line it shows a populated object.  Not sure why the above line of code keeps bombing. 

Can someone who has worked with these tools please verify to me that the sample project works for this tutorial. Any suggestions?

I am currently evaluating version 2008.3..1125.35 and using VS 3.5 SP 1

4 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 16 Jan 2009, 07:41 PM
Well I found a work around ....or maybe it is the actual solution.  I found that if I initialize the RadGrid.DataSource on the server-side Page_Load event to an empty List of contacts it will allow client side binding to work when I call the GetData() routine from the client Page_Load event and it will populate with data.

protected void Page_Load(object sender, EventArgs e)
{
            RadGrid1.DataSource = new List<Contact>();
            RadGrid1.DataBind();
}

If there is another solution please reply.
Thanks Michael
0
Sebastian
Telerik team
answered on 19 Jan 2009, 09:23 AM
Hello Michael,

Can you please verify that the tableView object is access properly in your code? This might be the reason for the javascript error you receive when invoking the set_dataSource(result) method from the client API of RadGrid.

Additionally, you may consider using declarative client-side binding as an alternative to the programmatic approach. Review the online resources pointed below for further details:

http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/DeclarativeDataBinding/DefaultCS.aspx
http://demos.telerik.com/aspnet-ajax/Grid/Examples/Client/DataBinding/DefaultCS.aspx

http://www.telerik.com/help/aspnet-ajax/client-side-binding.html

Finally, I suggest you migrate to the latest release Q3 2008 SP2 (2008.3.1314) of RadControls for ASP.NET AJAX following the steps from here.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Nuri
Top achievements
Rank 1
answered on 02 Apr 2009, 02:26 PM

Dear Sir/Madam;

I tried to use this sample, all are look like ok but when i use update button,
I got a message ; object doesnt support this method. "set_dataSource"
When I debug script code, I saw that tableView are ok. But it is look like MasterTableView object doesnt have member set_dataSource.

var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

 

 

tableView.set_dataSource(result);

 

 


what is wrong?

Thanks for your support. Sincerely.
Nuri

0
elmosi
Top achievements
Rank 2
answered on 19 Aug 2009, 06:07 AM
THANK YOU michael!!! i've been stuck on this problem for way too long. your trick solved it for me :)
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Sebastian
Telerik team
Nuri
Top achievements
Rank 1
elmosi
Top achievements
Rank 2
Share this question
or