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

no MasterTable object client side

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
adi
Top achievements
Rank 1
adi asked on 30 Jul 2008, 09:56 PM

Hi,

I'd like to use client side databinding with RadGrid Q2.2008 version. I've placed a RadGrid on page and would like to bind my data from WebService to it. I use the sample code: 

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

get_masterTableView returns nothing due to the fact that I don't bind any data to the RadGrid, I think. But I don't want to use server side datasource and I don't know how many columns I get from service. So I can't predefine the columns.
Has anybody an idea how to get RadGrid cooperative for that?

Thnx!

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Jul 2008, 05:43 AM
Hello adi,

Please assign an empty function for OnCommand event similar to this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/LiveData/DefaultCS.aspx

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
adi
Top achievements
Rank 1
answered on 31 Jul 2008, 08:35 AM
Hi Vlad,

thank you for your answer. I've tried it. But you say:

System.NotSupportedException: Client-side data-binding with auto-generated columns is not supported! Please declare at least one column for the grid. 

Therefore I can't use it how I would like to do. :-(

Adi
0
Sebastian
Telerik team
answered on 31 Jul 2008, 08:46 AM
Hello adi,

You need to define at least one declarative column in your grid to avoid the exception you received. Review the video from the following blog post on our site for more details:

http://blogs.telerik.com/KevinBabcock/Posts/08-07-30/RadTips_Episode_1_Client-Side_DataBinding_in_the_RadGrid.aspx?ReturnURL=%2fblogs%2f

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
adi
Top achievements
Rank 1
Answers by
Vlad
Telerik team
adi
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or