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

RadGridView not visible in my application

4 Answers 894 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Umar
Top achievements
Rank 1
Umar asked on 18 Apr 2017, 04:30 PM

Hi,

I am not able to see Telerik RadGridView in my WPF application, I have added resource dictionary in App.xaml,

 

App.xaml
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Data.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

 

But still I am unable to see RadGridView. I added RabButton and RadComboBox and both of these are visible in the view. I am consuming 2016.1.1013.45 version of Telerik binaries.

The code in my WizardWindow.xaml is,

<Window x:Class="Bentley.CatalogService.DownloadManager.WizardWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:wizard="clr-namespace:Telerik.Windows.Controls.Wizard;assembly=Telerik.Windows.Controls.Navigation"
        WindowStartupLocation="CenterScreen"
        xmlns:controls="clr-namespace:DownloadManager.Controls"
        Background="Transparent"
        Title="Components Center Download Manager" Height="500" Width="900" MinHeight="500" MinWidth="900">
    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="500"/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            <telerik:RadButton Content="Welcome to Download Manager" Grid.Column="0"/>
            <telerik:RadGridView x:Name="RadGridView1" Grid.Column="1"/>
            <telerik:RadComboBox Text="Select One Please" Grid.Column="2" />
        </Grid>
    </Grid>
</Window>

 

Any ideas?

 

4 Answers, 1 is accepted

Sort by
0
Roman
Top achievements
Rank 2
answered on 04 Apr 2018, 09:06 AM

We have the same problem with 2018.1.220.45 after updating VS to 15.6.4, these NoXAML Binaries are referenced (by the Configure Project Wizard):

- Telerik.Windows.Controls

- Telerik.Windows.Controls.GridView

- Telerik.Windows.Controls.Input

- Telerik.Windows.Controls.Navigation

- Telerik.Windows.Data

- Telerik.Windows.Themes.Office2016

 

RadToolBar(Tray) with Buttons visible, RadGridView not... did several attempts like clean and rebuild project, deleting and re-adding telerik assemblies by wizard, change theme, change version to 122 and back but nothing solved the problem.

0
Roman
Top achievements
Rank 2
answered on 04 Apr 2018, 11:18 AM

Okay, now we got the RadGridView visible. We had a style definition in Window.Resources for RadGridView. Placing the property definitions inline of RadGridView and deleting the style definition does the trick:

Do:

<Window.Resources>
  <vm:MyViewModel x:Key="viewModel"/>
</Window.Resources>
<Window.DataContext>
  <Binding Source="{StaticResource viewModel}" IsAsync="True"/>
</Window.DataContext>
<telerik:RadGridView ItemsSource="{Binding Definitions, IsAsync=True}" SelectedItem="{Binding SelectedDefinition, Mode=OneWayToSource}" GroupRenderMode="Flat" NewRowPosition="Bottom" AutoGenerateColumns="False" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Row="1" RowEditEnded="RadGridView_RowEditEnded">
</telerik:RadGridView>

 

Dont:

<Window.Resources>
  <vm:MyViewModel x:Key="viewModel"/>               
  <Style TargetType="{x:Type telerik:RadGridView}">
    <Setter Property="AutoGenerateColumns" Value="False"/>
    <Setter Property="GroupRenderMode" Value="Flat"/>
    <Setter Property="AlternationCount" Value="2"/>
    <Setter Property="AlternateRowBackground" Value="#FFF0F0F0"/>
  </Style>-->
</Window.Resources>
<Window.DataContext>
  <Binding Source="{StaticResource viewModel}" IsAsync="True"/>
</Window.DataContext>
<telerik:RadGridView ItemsSource="{Binding Definitions, IsAsync=True}" SelectedItem="{Binding SelectedDefinition, Mode=OneWayToSource}" NewRowPosition="Bottom" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Row="1" RowEditEnded="RadGridView_RowEditEnded">
</telerik:RadGridView>
0
Sia
Telerik team
answered on 06 Apr 2018, 01:39 PM
Hello,

I am happy to hear that you have managed to solve the experienced problem. The reason why the GridView appeared after removing the style is because when using NoXAML binaries and having a custom style, you need to base it on ours. In your case it is:
<Style TargetType="{x:Type telerik:RadGridView}" BasedOn="{StaticResource RadGridViewStyle}">
...
</Style>

More information can be found in our help about basing custom styles on a theme default style.


Regards,
Sia
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Roman
Top achievements
Rank 2
answered on 09 Apr 2018, 05:34 AM

Hi Sia,

omg ... you're right ... this makes sense ... *sigh*

Tags
GridView
Asked by
Umar
Top achievements
Rank 1
Answers by
Roman
Top achievements
Rank 2
Sia
Telerik team
Share this question
or