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

[Solved] Client Side Data Binding To Grid

4 Answers 182 Views
Grid
This is a migrated thread and some comments may be shown as answers.
azin ramezani
Top achievements
Rank 1
azin ramezani asked on 30 Jul 2009, 08:47 AM
hi,

I have a problem with binding data to a radgrid from client side!!!!
I have a WCFServiceLibrary where my service class and it's interface are in. In this service class I have defined the getAllPlaceDefinitions() method as follows :

public List<AccPlc> getAllPlaceDefinitions(int startIndex, int maxRowCount, int someParameter)
        {
            List<AccPlc> list = (from plc in Generals.DbList.AccPlcs
                                 select plc).ToList();

            return list;
        }


 In a WCFWebsite ,called http://localhost:11, I have defined my svc file(In folder BasicSetting). This file is called "PlacesDefinitionManager.svc".

In my ASP.Net website I used the radgrid, mastertable and I defined my columns in it.
Client Setting code is as follows :

<ClientSettings>
                        <DataBinding SelectMethod="getAllPlaceDefinitions"  Location="http://localhost:11/BasicSetting/PlacesDefinitionManager.svc"
                            EnableCaching="false">
                        </DataBinding>
                    </ClientSettings>

When I browse this page the grid brings some empty rows.:(  I think it doesn't find the svc file or cannot use it.
Would you please help me with my problem?!?!





4 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 31 Jul 2009, 06:24 AM
Hello azin ramezani,

You can find runnable example of RadGrid client-side data-binding on the following link:
http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx

You can use Fiddler or Firebug to see whether your service returns any valid JSON to client-side so RadGrid can bind to it.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
azin ramezani
Top achievements
Rank 1
answered on 01 Aug 2009, 07:11 AM
hi,

thank you very much for your attention.

My problem is still remaining!!!:( 
I check the adress that I gave as the Location in my clientsettings>databinding, and I could browse the .svc file.
But it doesn't working yet.

I also did a test with your sample codes. I gave the complete adress of the .svc file as Location parameter. 
It was as follows :
localhost:#(I added here the port number)/website/filename.svc

The first time I browsed the website it works, but when the port number changed and I changed the port number in the location it doesn't work any more!!


 
0
azin ramezani
Top achievements
Rank 1
answered on 02 Aug 2009, 08:06 AM
I compare my configuration files with your samples' and found the difference in this part of code :

my code :
<endpoint address="" binding="wsHttpBinding" contract="WcfService.BasicSetting.IPlacesDefinitionManager"
                  behaviorConfiguration="MyTestServiceBehavior">

and yours :

<endpoint address="" binding="webHttpBinding" contract="WcfService.BasicSetting.IPlacesDefinitionManager"
                  behaviorConfiguration="MyTestServiceBehavior">

when I changed my web.config file just in service website and used webHttpBinding my dataSetLoaded in the grid.
I want to know what is the difference between these two endpoint bindings?!?!? Why it doesn't work when I use wsHttpBinding?

thank you very much 
0
Nikolay Rusev
Telerik team
answered on 06 Aug 2009, 06:45 AM
Hello Azin,

As you probably know you may have multiple service endpoints. However to enable your service to work with ASP.NET AJAX you should have endpoint with webHttpBinding binding.

For more details you can check the following article:
http://dotnetslackers.com/articles/ajax/JSON-EnabledWCFServicesInASPNET35.aspx

Regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
azin ramezani
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
azin ramezani
Top achievements
Rank 1
Share this question
or