Telerik Forums
UI for WPF Forum
1 answer
119 views
I get the following exception when I paste from your WPF Controls Examples and reduce the contents of RadPanes (See xaml below).
Any suggestions for a way forward?

Anders, Denmark

Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.InternalWindow.PopupWindowHost.PopupHostManagerBase.GetManager(DependencyObject obj) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:line 308
   at Telerik.Windows.Controls.InternalWindow.SinglePopupWindowHost.GetHostManager() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\SinglePopupWindowHost.cs:line 22
   at Telerik.Windows.Controls.InternalWindow.PopupWindowHost.Open(Boolean isModal) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\InternalWindow\PopupWindowHost.cs:line 77
   at Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean isModal) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\Window\WindowBase.cs:line 891
   at Telerik.Windows.Controls.Docking.ToolWindow.Open() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Parts\ToolWindow.cs:line 121
   at Telerik.Windows.Controls.RadDocking.OpenInToolWindow(RadSplitContainer container) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 797
   at Telerik.Windows.Controls.RadDocking.InitializeSplitContainer(RadSplitContainer container) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 1325
   at Telerik.Windows.Controls.RadDocking.OnApplyTemplate() in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\Docking\Docking\Docking\RadDocking.cs:line 180
   at System.Windows.FrameworkElement.ApplyTemplate()
   at Microsoft.Expression.Platform.WPF.WpfViewNodeManager.EnsureElementInDictionary(Object root, ViewNode knownAncestor)



<
telerik:RadDocking x:Name="radDocking1" 
                    Grid.Row="1" Margin="0 0 0 10"
                    BorderThickness="0"
                    Padding="0" Background="{StaticResource LightGrayBrush}">
 
    <!--DocumentHost-->
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup>
                <telerik:RadDocumentPane Title="Description">
                </telerik:RadDocumentPane>
                <telerik:RadPane Header="NotDragable" CanFloat="False">
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
 
    <telerik:RadSplitContainer  MaxWidth="600" telerik:DockingPanel.InitialSize="210,150"
    Name="LeftContainer" InitialPosition="DockedLeft">
        <telerik:RadPaneGroup x:Name="Group1">
            <!--Server Exproler-->
            <telerik:RadPane x:Name="Pane1" Header="Server Explorer">
            </telerik:RadPane>
 
            <!--Toolbox-->
            <telerik:RadPane x:Name="Pane2" Header="Toolbox">
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
 
    <telerik:RadSplitContainer MaxWidth="679" telerik:DockingPanel.InitialSize="210,150"
    x:Name="RightContainer" InitialPosition="DockedRight">
        <telerik:RadPaneGroup x:Name="Group2">
 
            <!-- Solution Explorer -->
            <telerik:RadPane x:Name="Pane3" Header="Solution Explorer">
            </telerik:RadPane>
 
            <!--Properties-->
            <telerik:RadPane x:Name="Pane4" Header="Properties">
             </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
 
    <telerik:RadSplitContainer InitialPosition="FloatingDockable"
    telerik:RadDocking.FloatingLocation="450, 250"
    telerik:RadDocking.FloatingSize="300, 220">
        <telerik:RadPaneGroup>
            <telerik:RadPane Header="Not Document Pane" CanDockInDocumentHost="False">
             </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
 
    <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,180"
    x:Name="BottomContainer" InitialPosition="DockedBottom">
        <telerik:RadPaneGroup x:Name="Group3">
 
            <!-- Output -->
            <telerik:RadPane x:Name="Pane5" Header="Output">
             </telerik:RadPane>
 
            <!--Error List-->
            <telerik:RadPane x:Name="Pane6" Header="Error List">
             </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking>
Anders
Top achievements
Rank 1
 answered on 19 Apr 2013
1 answer
201 views
Hi,
I'm using Caliburn Micro as my MvvM framework and the Simple Injector IOC Container for developing an plugin based application. On the main application i have a RibbonView which loads its tabs on startup from .dll files.

So I have created a class library project where I define my xaml file with the RadRibbonTab Item.

<telerik:RadRibbonTab x:Class="TestTabLibrary.RibbonTabView"
                      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:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
                      Header="Plugin Test">
    <telerik:RadRibbonGroup Header="TestGoup 1">
        <telerik:RadRibbonButton Text="Button 1" cal:Message.Attach="[Event Click] = [Action Group1Button1]"/>
        <telerik:RadRibbonButton Text="Button 2" cal:Message.Attach="[Event Click] = [Action Group1Button2]"/>
    </telerik:RadRibbonGroup>
 
    <telerik:RadRibbonGroup Header="TestGoup 2">
        <telerik:RadRibbonButton Text="Button 1" cal:Message.Attach="[Event Click] = [Action Group2Button1]"/>
        <telerik:RadRibbonButton Text="Button 2" cal:Message.Attach="[Event Click] = [Action Group2Button2]"/>
    </telerik:RadRibbonGroup>
</telerik:RadRibbonTab>
 
Also I want to define the ViewModel class in this library.

public class RibbonTabViewModel : IViewModel
    {
        public void Group1Button1()
        {
            Console.WriteLine("Group1Button1");
        }
 
        public void Group1Button2()
        {
            Console.WriteLine("Group1Button2");
        }
 
        public void Group2Button1()
        {
            Console.WriteLine("Group2Button1");
        }
 
        public void Group2Button2()
        {
            Console.WriteLine("Group2Button2");
        }
    }

I have defined two Interface ITabItem and IViewModel to decorate the RibbonTabView and RibbonTabViewModel which are then registered in the bootstrapper calss in the main application.

public class AppBootstrapper : Bootstrapper<MainViewModel>
   {
       public static readonly Container PublicContainer = new Container();
       readonly string _pluginDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins");
        
       protected override void Configure()
       {
           PublicContainer.Register<IWindowManager, WindowManager>(Lifestyle.Singleton);
           PublicContainer.Register<IEventAggregator, EventAggregator>(Lifestyle.Singleton);
           PublicContainer.Register<MainViewModel>();
 
           var pluginAssemblies = from file in new DirectoryInfo(_pluginDirectory).GetFiles()
                                  where file.Extension == ".dll"
                                  select Assembly.LoadFile(file.FullName);
 
           var pluginTabItemsView = from dll in pluginAssemblies
                                    from type in dll.GetExportedTypes()
                                    where typeof(ITabItem).IsAssignableFrom(type)
                                    where !type.IsAbstract
                                    where !type.IsGenericTypeDefinition
                                    select type;
 
           PublicContainer.RegisterAll<ITabItem>(pluginTabItemsView);
 
           var pluginTabItemsViewModel = from dll in pluginAssemblies
                                    from type in dll.GetExportedTypes()
                                    where typeof(IViewModel).IsAssignableFrom(type)
                                    where !type.IsAbstract
                                    where !type.IsGenericTypeDefinition
                                    select type;
 
           PublicContainer.RegisterAll<IViewModel>(pluginTabItemsViewModel);
            
           PublicContainer.Verify();
       }
 
       protected override IEnumerable<object> GetAllInstances(Type service)
       {
           return PublicContainer.GetAllInstances(service);
       }
 
       protected override object GetInstance(Type service, string key)
       {
           return PublicContainer.GetInstance(service);
       }
   }

So far, so good. The classes are registered correctly and I can get an instance from them.

Next in the main xaml I simply have my RadRibbonView

<telerik:RadRibbonWindow x:Class="EtaStudio.View.MainView"
                         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"
                         Title="MainView" Height="300" Width="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <telerik:RadRibbonView Grid.Row="0" ApplicationName="Eta Studio" ItemsSource="{Binding Items}"/>
    </Grid>
</telerik:RadRibbonWindow>

This View is bound to my MainVIewModel

public class MainViewModel : Conductor<ITabItem>.Collection.OneActive
   {
       public MainViewModel()
       {
           IEnumerable<ITabItem> instances = AppBootstrapper.PublicContainer.GetAllInstances<ITabItem>();
           Items.AddRange(instances);
       }
   }

Overall the tab is loaded correctly but when I click a button the wrong ViewModel is used, in this case the MainViewModel.
How can i achieve it to bind to the RibbonTabViewModel?

Best Regards
Markus
Klemens
Top achievements
Rank 1
 answered on 19 Apr 2013
1 answer
142 views
i cant seem to find a whole lot of info about how it works, are there beginner guides to the telerik wpf?
I downloaded 30days trial demo, but it just shows gui? The gui needs to be connected to my code behind, and this connection is what i cant find.
One thing i wanted to try was to make a button unEnabled after you press it, should be easy? I've tried a couple of things and none seems to work, please tell me what im doing wrong!
<Views:CustomViewBase.RibbonInformation>
    <entities:RibbonInformation Header="Operation">
        <entities:RibbonInformation.RibbonGroups>
            <telerik:RadRibbonGroup  x:Name="UIRibbonToolbar"  Header="Controls">
                 
                <telerik:RadRibbonButton Text="Back"
                                         Size="Large"
                                         LargeImage="/Images/Back.bmp"
                                         Click="RadRibbonButton_Click_Back"
                                         Name="RadRibbonButton_Back"
                                         IsEnabled="True"/>
                <telerik:RadRibbonButton Text="Play"
                                         Size="Large"
                                         LargeImage="/Images/Play.bmp"
                                         Click="RadRibbonButton_Click_Play"
                                         Name="RadRibbonButton_Play"
                                         IsEnabled="True"/>
                <telerik:RadRibbonButton Text="Stop"
                                         Size="Large"
                                         LargeImage="/Images/Stop.bmp"
                                         Click="RadRibbonButton_Click_Stop"
                                         Name="RadRibbonButton_Stop"
                                         IsEnabled="True"/>
                 
            </telerik:RadRibbonGroup>
        </entities:RibbonInformation.RibbonGroups>
    </entities:RibbonInformation>
</Views:CustomViewBase.RibbonInformation>
XAML
private void RadRibbonButton_Click_Stop(object sender, RoutedEventArgs e)
{
    this.IsEnabled = false;
    MessageBox.Show("Stop Button Pressed");
}
private void RadRibbonButton_Click_Play(object sender, RoutedEventArgs e)
{
    this.IsEnabled = false;
    MessageBox.Show("Play Button Pressed");
}
private void RadRibbonButton_Click_Back(object sender, RoutedEventArgs e)
{
    this.IsEnabled = false;
    MessageBox.Show("Back Button Pressed");
}
C#
Pavel R. Pavlov
Telerik team
 answered on 18 Apr 2013
1 answer
282 views
Hi -

I have a RadGridView bound to a DataTable. Some columns in the table are calculated (via the Expression in the DataColumn).
E.g. I have 3 columns called Position, Demand, and Generation. Position is setup like this (where table is the DataTable):

DataColumn dc = table.Columns["Position"];
dc.Expression = "-Demand+Generation";

(Actually it gets more complicated - there are up to 250+ columns about which I be submitting another question!)

The problem I have here is that when I change either the Demand or Generation column the Grid isn't picking up on the change to the Position column. If I switch to another window in the app and then back, or scroll so that the Position column isn't visible (there are a lot of columns!) then the new calculated figure is shown correctly.

Is there any way I can force the refresh of this calculated column without having to get the users to do this?

Thanks -
svs
Top achievements
Rank 1
 answered on 18 Apr 2013
6 answers
186 views
Dear sir,

I want to make a own custom settings pan to a custom diagram shape.
I referred to a Mindmap example in the  WPF demo. 
I tried to make SettingsPane.xaml like the Mindmap sample, but RadTabControl in SettingsPane.xaml seems to be worked abnormally.
It display a RadTabControl but it can not display RadTabItem content.

Could you tell me how to make a custom settings pan with TabControl?

I tested it with your demo source as follows.

[SettginsPan.xaml of Diagrams.WPF project in Demo]
<UserControl x:Class="Telerik.Windows.Examples.Diagrams.MindMap.SettingsPane"
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:local="clr-namespace:Telerik.Windows.Examples.Diagrams.MindMap"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" d:DesignHeight="300" d:DesignWidth="300"
mc:Ignorable="d">
<Border MouseLeftButtonDown="Border_MouseLeftButtonDown">
<Grid Margin="15 15 0 15">
            <telerik:RadTabControl>
                <telerik:RadTabItem Header="General" Content="hello"/>
                <telerik:RadTabItem Header="Video Profiles"  Content="hello2"/>
            </telerik:RadTabControl>

       </Grid></Border>

It can't display content of RadTabItem. Actually I want to insert RadGridView into RadTabItem, but It doesn't work.
My custom shape should display fully customized settings pan content with tab control.

Thank you.
Pavel R. Pavlov
Telerik team
 answered on 18 Apr 2013
3 answers
316 views

Hello everyone, I've done recently the upgrade from WPF Q2 2012 to Q1 2013 and I've a strange problem with RadGridView.

In my project I've created an extension of Windows context menu, adding my custom options, and using one of these option a show a WPF Window that contained a RadGridView.
This Windows accepts some criteria to perform a search and its results is displayed into RadGridView. To avoid Windows freeze I've done a BackgroundWorker that call the backend WCF and after that update RadGridView.

In particular I've used MVVM pattern and before start BackgroundWorker I've used a RadBusyIndicator to show that current Window is busy during search operation.
With WPF Q2 2012 all works fine and, after search, RadGridView is updated correctly with operation results but when I upgrade my project to Q1 2013 I've the following exception when I try update RadGridView :
"The calling thread cannot access this object because a different thread owns it".

I try to search in this forum and I didn't find any idea to solve it, but in the release notes of Q1 2013 RadGridView I read this :
BUGFIX : "Support for source collection changes from a thread that is different from the UI thread".

Could it somehow involve with my problem?

Thanks in advance, Regards
Davide
Pavel R. Pavlov
Telerik team
 answered on 18 Apr 2013
6 answers
358 views
I've attached a sample project showing me trying to load 5000 rows and 14 columns. The data load happens when you click the button labeled "Push". This seems like it takes far too long to load this amount of data. Here is the XAML and designer code:

XAML:
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="WpfApplication2.MainWindow"
        Title="MainWindow" Height="350" Width="525" >
    <Grid>
        <StackPanel>
            <Button Content="Push" Click="Button_Click" />
            <telerik:RadGridView  ItemsSource="{Binding Data}" ColumnWidth="100" MaxColumnWidth="100"/>
        </StackPanel>
 
    </Grid>
</Window>

Designer:
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
 
    public IEnumerable<DataItem> Data {get;set;}
 
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        var data = new List<DataItem>();
        for (int i = 0; i < 5000; i++)
        {
            data.Add(new DataItem());
        }
 
        this.Data = data;
        this.DataContext = this;
    }
}
 
 
 
public class DataItem
{
    public string Col {get;set;}
    public string Col2 { get; set; }
    public string Col3 { get; set; }
    public string Col4 { get; set; }
    public string Col5 { get; set; }
    public string Col6 { get; set; }
    public string Col7 { get; set; }
    public string Col8 { get; set; }
    public string Col9 { get; set; }
    public string Col0 { get; set; }
    public string Col11 { get; set; }
    public string Col12 { get; set; }
    public string Col13 { get; set; }
    public string Col14 { get; set; }
}

I should add that this is using version 2012.2.912.40 of the WPF RadGridView component in a .NET 4.5 WPF application.

Dimitrina
Telerik team
 answered on 18 Apr 2013
2 answers
158 views
-
Vlad
Telerik team
 answered on 18 Apr 2013
1 answer
226 views
Hi, I have a project where I synchronize multiple controls. The RadGridView control is bound to an observable collection of data. Whenever I need to select multiple items, I execute
grid.UnselectAll();
grid.SelectedItems.Add(element);
.... do this for all selected elements .....

The grid does what it's suppose to do, however, I need to customize all selected rows to have blue font color. At first I tried using
grid.ItemContainerGenerator.ContainerFromItem(item) as GridViewRow

However I quickly learned that this will only work for rows currently visible (based on some other threads I have read). The item itself does not have any kind of "IsSelected" property, so customizing styles probably will not work. I am looking for a c#-based code solution to find all necessary rows and change the Foreground property.

Thanks in advance
Maya
Telerik team
 answered on 18 Apr 2013
1 answer
202 views
Hi,
I followed this example to add a button column in my grid using the data template solution
http://www.telerik.com/help/wpf/gridview-add-button-column.html

By default all the buttons have Visibility = "Hidden". I want to button to be made visible when user select a row.
By handling SelectionChanged Event and accessing SelectedItem I do get the selected row. But after that I have no idea how to access the custom column ..i.e. Radbutton in the selected row and change its property. Any ideas?

Thanks.
Vlad
Telerik team
 answered on 18 Apr 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?