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

[Solved] Grid over WCF: net.pipe

3 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
peter
Top achievements
Rank 1
peter asked on 09 Jun 2010, 10:52 AM
Is it possible to bind a grid to a WCF service of net.pipe type instead of http ?

I tried it but I'm getting a jquery "Access denied" error. I guessing my service address is the problem.

       <%= Html.Telerik().Grid<ProjektDTO>() 
              .Name("WCF") 
              .DataBinding(db => db.WebService().Select("net.pipe://localhost/ProjektyService")) 
              .Pageable() 
              .Sortable() %> 

[ServiceContract(Namespace = "")] 
    [NetDataContractFormatAttribute] 
    public interface IProjektyService 
    { 
        [OperationContract] 
        GridModel GetOrders(GridState state); 
    } 
 
 [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
    public class ProjektyService : IProjektyService 
    { 
       
 
        public GridModel GetOrders(GridState state) 
        { 
            using (DataAccessAdapter adapter = new DataAccessAdapter()) 
            { 
                LinqMetaData metaData = new LinqMetaData(adapter); 
 
                var projekty = from p in metaData.TfProjekty 
                                                  select new ProjektDTO 
                                                             { 
                                                                 Id = p.Id, 
                                                                 DatumVytvorenia = p.DatumVytvorenia, 
                                                                 LLBLGenProEntityName = p.LLBLGenProEntityName, 
                                                                 NazovProjektu = p.NazovProjektu, 
                                                                 Oz = p.Oz, 
                                                                 PopisProjektu = p.PopisProjektu, 
                                                                 Poznamka = p.Poznamka 
                                                             }; 
 
                return projekty.ToGridModel(state); 
            } 
        } 
    } 

3 Answers, 1 is accepted

Sort by
0
peter
Top achievements
Rank 1
answered on 10 Jun 2010, 09:31 AM
Haloo no one ? :-)
0
Atanas Korchev
Telerik team
answered on 10 Jun 2010, 09:46 AM
Hi peter,

Telerik Grid for ASP.NET MVC is using jQuery.ajax for making WCF requests. As far as I know the latter supports only HTTP requests. Which makes "net.pipe" unsupported.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Joao Cardoso
Top achievements
Rank 1
answered on 14 Jun 2010, 04:41 PM

Personally I would recommend creating a viewmodel class that would deal with the WCF service invoke and bind the grid with a datasource generated from that.

That way you can use whatever binding you need to the wcf service and at the same time provide some translation of service results to a more friendly viewmodel to bind to your view.

The overhead of this is not that much and the advantages are significant. For instance you can decorate your viewmodel class with attributes on required fields, and such. If you plan to use the same viewmodel for edit that is.

Just my 2 cents,

Cheers

Joao Cardoso

Tags
Grid
Asked by
peter
Top achievements
Rank 1
Answers by
peter
Top achievements
Rank 1
Atanas Korchev
Telerik team
Joao Cardoso
Top achievements
Rank 1
Share this question
or