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

RadGridView & RIA Data Sources

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sir
Top achievements
Rank 1
Sir asked on 03 Jun 2010, 11:55 PM
I am using VS2010 Ultimate with RIA Services,
 and Telerik Silverlight 2010.1.0603.1040

When I open my Data Sources tab in VS, and drag a database table (MS Data Grid) into the designer -
The xaml is automatically written out with the grid and each column from the table.
I can also go into the grid properties, click on the columns ellipse button, and edit each of the data columns from the table.

Now, when I change my data sources tab to generate a RadGridView by default, and drag the same table into the designer -
The xaml only shows a radgridview - there are no <telerik:RadGridView.Columns/> written out.
If I go into the radgrid properties, click on the columns ellipse button, there are no entries.

Is there a way to get the radgridview to write out each column, and I'm just not doing something correctly?
Or are there plans to add this later?

My company wants to go with RIA data sources, and it will be hard for me to convince the company to continue using Telerik controls when I have to tell them that each developer will need to add the <telerik:RadGridView.Columns/> xaml by hand.

Generated for MS Data Grid:
<sdk:DataGrid Grid.Row="0" AutoGenerateColumns="False" ItemsSource="{Binding ElementName=eventDomainDataSource, Path=Data}" Margin="12,0,12,12" Name="eventDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected">  
    <sdk:DataGrid.Columns> 
        <sdk:DataGridTextColumn x:Name="eventTitleColumn" Binding="{Binding Path=EventTitle}" Header="Event Title" Width="SizeToHeader" MinWidth="250" /> 
        <sdk:DataGridTemplateColumn x:Name="eventStartDateColumn" Header="Event Start Date" Width="SizeToHeader">  
            <sdk:DataGridTemplateColumn.CellEditingTemplate> 
                <DataTemplate> 
                    <sdk:DatePicker SelectedDate="{Binding Path=EventStartDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" /> 
                </DataTemplate> 
            </sdk:DataGridTemplateColumn.CellEditingTemplate> 
            <sdk:DataGridTemplateColumn.CellTemplate> 
                <DataTemplate> 
                    <TextBlock Text="{Binding Path=EventStartDate, StringFormat=\{0:d\}}" /> 
                </DataTemplate> 
            </sdk:DataGridTemplateColumn.CellTemplate> 
        </sdk:DataGridTemplateColumn> 
        <sdk:DataGridTemplateColumn x:Name="eventEndDateColumn" Header="Event End Date" Width="SizeToHeader">  
            <sdk:DataGridTemplateColumn.CellEditingTemplate> 
                <DataTemplate> 
                    <sdk:DatePicker SelectedDate="{Binding Path=EventEndDate, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" /> 
                </DataTemplate> 
            </sdk:DataGridTemplateColumn.CellEditingTemplate> 
            <sdk:DataGridTemplateColumn.CellTemplate> 
                <DataTemplate> 
                    <TextBlock Text="{Binding Path=EventEndDate, StringFormat=\{0:d\}}" /> 
                </DataTemplate> 
            </sdk:DataGridTemplateColumn.CellTemplate> 
        </sdk:DataGridTemplateColumn> 
        <sdk:DataGridTextColumn x:Name="eventVenueNameColumn" Binding="{Binding Path=EventVenueName}" Header="Event Venue Name" Width="SizeToHeader" MinWidth="200" /> 
        <sdk:DataGridTextColumn x:Name="eventDescriptionColumn" Binding="{Binding Path=EventDescription}" Header="Event Description" Width="*" /> 
    </sdk:DataGrid.Columns> 
</sdk:DataGrid> 
 

Generated for Telerik RadGridView:
<telerikPresentation:RadGridView Grid.Row="1" ItemsSource="{Binding ElementName=eventDomainDataSource, Path=Data}" Margin="12,0,12,12" Name="eventDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" /> 

Thanks,
Ray

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Jun 2010, 12:14 PM
Hello Ray,

This is since the standard Silverlight DataGrid will disable auto-generated columns in this case and will add these columns to the columns collection. RadGridView will not do that - our grid will use auto-generated columns. Nevertheless I've logged this in our PITS and if more people vote for this we will implement it for sure!

Best wishes,
Vlad
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
Rudy
Top achievements
Rank 1
answered on 17 Jun 2010, 02:34 AM
Hi Vlad,

thanks for your quick response.

I'm completely new to Silverlight so this might sound stupid. I'm doing the Cannel 9 Silverlight training modules and as Ray mentions, I drag the event table into the designer which creates a MS DataGrid containing all the columns. Then I select the column collection and delete the EventID because it is an auto key field that I do not want to display. To reorder the columns I move them up/down.

Now I want to achieve the same with the RadGridView. Is there an easy way to do this as well or do I have to add all but one column manually just because I do want to have one single column hidden and have a certain display order of the other columns?

regards
Rudy
0
Vlad
Telerik team
answered on 17 Jun 2010, 06:29 AM
Hi Rudy,

 You can check the XAML generated in this case for the DataGrid and RadGridView. The DataGrid will have columns declared in XAML and RadGridView will not.

Regards,
Vlad
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
Sir
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Rudy
Top achievements
Rank 1
Share this question
or