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

[Solved] WCF Data Service Binding with Authentication

0 Answers 89 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.
David Bakker
Top achievements
Rank 1
David Bakker asked on 22 Sep 2011, 04:41 PM
I have a WCF data service (odata) where we use a custom authentication method by inserting a custom header into the request.  It looks like the only way to bind the MVC grid to the service and get proper paging is by providing the URL to the service.  I would like to be able to bind to a DB Model Container like I can in the WCF Control.  Is this possible?  If not, what is the best way to make sure that I can get WCF data service paged data into the MVC Grid?

XAML from my WCF Project:
<Grid>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <telerik:RadGridView x:Name="GridView" ItemsSource="{Binding PagedSource, ElementName=radDataPager}" AutoGenerateColumns="True" Grid.Row="0" Width="700" Height="350" />
            </Grid>
        </Grid>
        <telerik:RadDataPager Name="radDataPager" PageSize="10" Grid.Row="1" DisplayMode="FirstLastPreviousNextNumeric, Text" />

Code behind from my WCF Project:
MDP2DBModelContainer context = new MDP2DBModelContainer(serviceRootUri);
//add headers to context.SendingRequest
 
radDataPager.Source = context.PagedData;

What I'd like to do in my MVC Project:
@using Telerik.Web.Mvc.UI
@model modelWithContext
 
@(Html.Telerik().Grid(Model.Context.PagedData)
                .Name("ActivitiesGridModelBound")
                .Groupable()
                .Sortable()
                .Scrollable()
                .Pageable()
                .Filterable()
)
Tags
Grid
Asked by
David Bakker
Top achievements
Rank 1
Share this question
or