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

Grid + RIA + Paging + custom columns in select

6 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vilen Tambovtsev
Top achievements
Rank 1
Vilen Tambovtsev asked on 29 Mar 2010, 03:08 PM
I've implemented databound grid with RIA services. Now I want only visible columns to be selected in database . Is there any way to implement it w/ or w/o codebehind?
<UserControl xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"  xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"  x:Class="RadControlsSilverlightApp3.MainPage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  
    xmlns:sl="clr-namespace:RadControlsSilverlightApp3.Web" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:Controls1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    <UserControl.Resources> 
    </UserControl.Resources> 
    <Grid x:Name="LayoutRoot"
        <Grid.ColumnDefinitions> 
            <ColumnDefinition/> 
            <ColumnDefinition/> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
            <RowDefinition/> 
            <RowDefinition/> 
        </Grid.RowDefinitions> 
        <riaControls:DomainDataSource x:Name="domainDataSource" 
                             AutoLoad="True" 
                             QueryName="GetRegLimitVolumeAppropriations" 
                             PageSize="100"
            <riaControls:DomainDataSource.DomainContext> 
                <sl:DomainService1 /> 
            </riaControls:DomainDataSource.DomainContext> 
        </riaControls:DomainDataSource> 
        <telerik:RadGridView x:Name="radGridView" 
                    ItemsSource="{Binding Data, ElementName=domainDataSource}" 
                    IsBusy="{Binding IsBusy, ElementName=domainDataSource}" Margin="0,50,0,50" 
                             EnableColumnVirtualization="True" EnableRowVirtualization="True" Grid.Column="0" Grid.Row="0" 
                             SelectionMode="Extended" AutoGenerateColumns="False"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Contingnt}" Header="First Name" UniqueName="FirstName" /> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding id}" Header="Идентификатор" UniqueName="Id" /> 
            </telerik:RadGridView.Columns> 
 
        </telerik:RadGridView> 
        <telerik:RadDataPager x:Name="radDataPager" 
                     Source="{Binding Data, ElementName=domainDataSource}" 
                     DisplayMode="FirstLastPreviousNextNumeric, Text" 
                     IsTotalItemCountFixed="True" VerticalAlignment="Bottom" Grid.Column="0" Grid.Row="0" /> 
    </Grid> 
</UserControl> 
 

6 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 29 Mar 2010, 04:02 PM
Hi Vilen Tambovtsev,

Actually, it is the other way around -- depending on the model that you have created on the server you receive data on the client. For example, if your entity has a property called "Name' defined on the server, you can display a column showing this name on the client. The client cannot change the data model that is defined on the server. I hope that this is clear.

To learn more about WCF RIA Services please check this topic out.

All the best,
Ross
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
Vilen Tambovtsev
Top achievements
Rank 1
answered on 29 Mar 2010, 04:51 PM
But at the same time, domainservice exposed IQueryable<T>, so, on the client GridView could do something like data.Select(a => new { a.DefinedColumn, a.DefinedColumn2 ....etc }). Will this make difference?
0
Vilen Tambovtsev
Top achievements
Rank 1
answered on 31 Mar 2010, 12:00 PM
No answer?
0
Rossen Hristov
Telerik team
answered on 31 Mar 2010, 12:06 PM
Hi Vilen Tambovtsev,

We wish we could help you, but currently we are not aware of a way to do what you are requesting.

Since your question seems to be closely related to WCF RIA Services rather than to RadGridView in particular, you can try to post the same question on the Microsoft forums. Simply replace RadGridView with MS DataGrid. The guys from MS might know of a way to do the things that you want to do.

I hope this helps.

Sincerely yours,
Ross
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
Vilen Tambovtsev
Top achievements
Rank 1
answered on 31 Mar 2010, 01:55 PM
Thanks for your reply. I've tried some hacking myself, but no luck:
var bs = context.Budgets.Select(b => new {b.id, b.isGroup}).ToList(); 
            context.Load(context.GetBudgetsQuery()).Completed += (aa, bb) => context.Budgets.Select(b => new { b.id, b.isGroup }).ToList() 

And still having a full query in the Db
0
Rossen Hristov
Telerik team
answered on 31 Mar 2010, 02:00 PM
Hi Vilen Tambovtsev,

Probably because it is impossible. Did you ask this on the MS forums or not?

Kind regards,
Ross
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.
Tags
GridView
Asked by
Vilen Tambovtsev
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Vilen Tambovtsev
Top achievements
Rank 1
Share this question
or