Telerik Forums
UI for WPF Forum
5 answers
342 views
I am evaluating Telerik for use in a WPF 4.0 app I am creating.  So far most of the replacement of MS controls has gone smoothly but I am struggling with the tabcontrol some.  I am using MVVM.  I have a view model which has a collection of other viewmodels.  My tabcontrol is bound to the collection of viewmodels.  I want my tabcontrol to show its content based on the viewmodel created/selected.  I have DataTemplates set up that are tied to the class type of the viewmodels in the collection.  This works great with the MS Tabcontrol but does not seem to work with the RadTabControl.  Does the RadTabControl only support one type of content?  My view collection starts out with two items in it, a DeviceInventoryListViewModel and an AccountMaintenanceListViewModel, the DeviceInventoryList view is shown correctly as the initial tab content but when I click on the Account tab it tries to coerce the contents of the AccountListViewModel into the Device view rather than creating new content with the AccountMaintenanceList view and I get an error about Accounts not being able to be set to Devices (or something similar).

I have the following set up in my Application.xaml:
<P><DataTemplate DataType="{x:Type vm:DeviceInventoryListViewModel}"
<BR> <local:DeviceInventoryList/> <BR></DataTemplate
<BR><DataTemplate DataType="{x:Type vm:AccountMaintenanceListViewModel}"
<BR> <local:AccountMaintenanceList /> <BR></DataTemplate></P>

My ShellViewModel is as follows:
Public Class ShellViewModel
    Inherits ViewModelBase

    Private _openviews As ObservableCollection(Of ViewModelBase)
    Private _currentview As ViewModelBase

    Public ReadOnly Property Views As ObservableCollection(Of ViewModelBase)
        Get
            If _openviews Is Nothing Then
                _openviews = New ObservableCollection(Of ViewModelBase)
                 AddHandler _openviews.CollectionChanged, AddressOf ViewCollectionChanged
                 LoadDefaultViews()
            End If
            Return _openviews
        End Get
    End Property
 
    Private Sub LoadDefaultViews()
        _openviews.Add(New DeviceInventoryListViewModel)
        _openviews.Add(New AccountMaintenanceListViewModel)
        _currentview = _openviews.Item(0)
    End Sub

 
   Public Property SelectedView As ViewModelBase
         Get
             Return _currentview
         End Get
         Set(ByVal value As ViewModelBase)
            _currentview = value
            OnPropertyChanged("SelectedView")
        End Set
    End Property
End Class

And then my ShellView has its DataContext set to an instance of my ShellViewmodel and the XAML contains the following:

<telerik:RadTabControl Grid.Row="1" ItemsSource="{Binding Views}"  
    SelectedItem="{Binding SelectedView}" />
Tina Stancheva
Telerik team
 answered on 07 Oct 2010
1 answer
132 views
I´m working on an app with the following architecture, I´m using CSLA .NET 4, BXF for plumbing to MVVM and WPF.

Files code follow:

TreeviewView.xaml
------------------------
<UserControl x:Class="MyAppDesktopWPF.TreeviewView"       
         
         
xmlns:Telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:csla="clr-namespace:Csla.Data;assembly=Csla"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400"
Loaded="UserControl_Loaded"
xmlns:my="clr-namespace:MyAppDesktopWPF.ViewModels">

<UserControl.Resources>

<
CollectionViewSource x:Key="TreeAreaDS" Source="{Binding
Source={StaticResource TrashViewModel},
Path=Model}"></CollectionViewSource>

<
HierarchicalDataTemplate x:Key="ToolsDataTemplate"ItemsSource="{Binding Tools}" >
            <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
</
HierarchicalDataTemplate>

        <HierarchicalDataTemplate x:Key="SegmentsDataTemplate"
ItemsSource="{Binding Segments}" ItemTemplate="{StaticResource ToolsDataTemplate}" >
            <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
        </HierarchicalDataTemplate>

        <HierarchicalDataTemplate  x:Key="SectionsDataTemplate" 
ItemsSource="{Binding Sections}" ItemTemplate="{StaticResource
SegmentsDataTemplate}">
            <TextBlock Text="{Binding Path=Name}"
FontWeight="Bold"/>
        </HierarchicalDataTemplate>

    </UserControl.Resources>

<Telerik:RadTreeView ItemsSource="{Binding Source={StaticResource
TreeAreaDS}}" ItemTemplate="{StaticResource SectionsDataTemplate}"
Name="PlanTreeView" Height="250" HorizontalAlignment="Left" Margin="3"
VerticalAlignment="Center" Width="150" />

TrashViewModel.cs
------------------------
public class TrashViewModel : ViewModel<MyAppBO.MyClass>
    {
        public TrashViewModel()
        {
            Bxf.Shell.Instance.ShowStatus(new Bxf.Status { Text =
"Getting Plan", IsBusy = true });
            ManageObjectLifetime = true;
            // cascade model changed events through VM to View
            Model.PropertyChanged += (o, e) =>
OnPropertyChanged(e.PropertyName);
        }

        public TrashViewModel(MyClass classInstance)
        {
            Bxf.Shell.Instance.ShowStatus(new Bxf.Status { Text =
"Getting Plan", IsBusy = true });
            ManageObjectLifetime = true;
            Model = classInstance;

            // cascade model changed events through VM to View<br>
            Model.PropertyChanged += (o, e) =>
OnPropertyChanged(e.PropertyName);
        }


With this version of the code I get an exception that says:
"'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Line number '108' and line position '50'."
---------------------
However if I change the code for the collectionviewsource to:
  <CollectionViewSource x:Key="TreeAreaDS"
Source="TrashViewModel">
</CollectionViewSource>


I get this:
Locating source for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'. Checksum: MD5 {d5 92 43 67 7f ad 5a 42 93 7e b9 53 ee b2 ef 99}
The file 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs' does not exist.
Looking in script documents for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'...
Looking in the projects for 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs.
The debugger could not locate the source file 'c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Core\Controls\Animation\AnimationManager.cs'.

???
Any ideas?
I could try setting up a demo project, but I´d expose too much of the BL of the app and my employer wouldn´t like that..

Alex Fidanov
Telerik team
 answered on 07 Oct 2010
2 answers
111 views
Hello friends,

could you tell me how I can set the alignment for the content of the FooterCells?
I tried to set it with style. That works, but the result is not very fine (screenshot hc_466.jpg).

<Style TargetType="{x:Type telerik:GridViewFooterCell}">
    <Setter Property="HorizontalAlignment" Value="Right"/>
</Style>

How is it possible to fill out the whole cells with white background? Setting the background-property via style does not work.

Second question: When I use grouping and ColumnFooters (ShowGroupFooters ="False" ShowColumnFooters="True") the aggregatresults are shown in the header too. That's not very pretty. Is it possibly to disable this? (screenshot hc_465.jpg).

Thank you for your help!

Best regards
Markus
Markus
Top achievements
Rank 1
 answered on 07 Oct 2010
1 answer
138 views
Hi

 Am using Radgridview control. Am not able to change  color for  a particular cell after editing the column value.

 Am using this code in cellValidating event.

                if (e.OldValue != e.NewValue)
                {
                    e.Cell.Background = Brushes.Green;
                }

The color is not changed :(
Vanya Pavlova
Telerik team
 answered on 07 Oct 2010
1 answer
134 views
Is possible to put a image in the Item Header?

Regards,
Rick Mueller
Alex Fidanov
Telerik team
 answered on 07 Oct 2010
1 answer
117 views
Hi,

I was wondering whether RadBarPanel  has the ability to collapse.
 For example to have a button in the upper right corner which hides it when clicked, or  expands it (just like panels in MS Outlook behave ).
if barPanel doesn`t include this functionality, do you have any suggestions how to implement it.

Thanks in advance,
Maria
Kiril Stanoev
Telerik team
 answered on 07 Oct 2010
1 answer
111 views
Hello,

I don't know if I'm doing something wrong, but everytime a load a Usercontrol , RadGridview anything thats sort of robust in a tile. I have Performance issues(very slow, automation is off, Please mind you I don't have the grid databind the Usercontrol is simple. THere are no datacontext to the tile etc.. Please help
Regard's
Rick
Kiril Stanoev
Telerik team
 answered on 07 Oct 2010
1 answer
103 views
I want to develop a sales dashboard (WPF) using VS 2008. I need to know which versions of radcontrols for WPF should i download to work with VS 2008. Also what other telerik controls do i need to install to develop a dashboard?
Veselin Vasilev
Telerik team
 answered on 07 Oct 2010
1 answer
99 views
I downloaded the sales dashboard demo for WPF from this link
http://www.telerik.com/account/free-trials/trial-product-versions/single-trial.aspx?pmvid=0&pid=601

But the solution file does not open with VS2008. Where can i download the demo for VS 2008?
Veselin Vasilev
Telerik team
 answered on 07 Oct 2010
1 answer
92 views
i am using a RadChart and have 3 line series mapping. The item sourse to it is list collection of a single dimensional array. I am able to diplay the graph for 12 points on X-axis.The problem i have is that the X-Axis Label take values as 1,2,3 series. i want the name of months on these labels. Checked the forum and saw that TickPointsCollections can be used. But my radchart has no tick point collectin and has count of zero.
What should i do?
Evgeni "Zammy" Petrov
Telerik team
 answered on 07 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?