Telerik Forums
UI for WPF Forum
2 answers
120 views
Hi

Are there support for custom attributes on individual elements in the RichTextBox, or some possibility to extend the RTB to support it?
What i would like to achieve is to programmatically add, say an ID (or other forms of metadata), to individual elements on the canvas such as an image, a table, footnote and so on, and then be able to track/read the attributes at a later point via exported xaml from the XamlFormatProvider.

Hope this makes sense.

Best regards,
Terje
Terje
Top achievements
Rank 1
 answered on 19 Apr 2013
1 answer
424 views
I have a RadGridView which has its ItemsSource property bound to the the DefaultView of a DataTable that is created and updated by a ViewModel.  The GridView has the AutoGenerateColumns property set to true.

When columns are added to this DataTable and the PropertyChanged event is fired, the new columns are not added to the GridView.

Also, when columns are removed from the DataTable and the PropertyChanged event is fired, the data from these columns is removed from the GridView, but not the columns themselves.

Does the AutoGenerateColumns property only generate columns when the control is initialized?  Does this behavior of dynamically removing and adding columns as the underlying DataTable is changed not exist?
Pavel Pavlov
Telerik team
 answered on 19 Apr 2013
1 answer
221 views
Not sure if this is an issue or I'm just using it wrong....
I am trying to capture when a User "Clicks" a Tile in my Tile List and then perform an Action.  The below works okay except that if one Tile is currently selected and you Click a new Tile the Event below will fire 3 times.  Twice with the new Tile as an AddedItem thereby firing my Method twice.  

How can I do this different so as to not have my method fire multiple times?  Is there a different event I should look at?  I was able to capture the Tile's MouseDoubleClick event but that isn't truly what I want to do.

This is a WPF 4.5 app using Telerik release(2013.1.403.45).

<telerik:RadTileList x:Name="AppLaunchPad"
          GroupTemplate="{StaticResource GroupTemplate}"
          ScrollViewer.HorizontalScrollBarVisibility="Visible"
          cal:Message.Attach="[Event SelectionChanged] = [Action OpenDoorway($eventArgs)]">

public void OpenDoorway(SelectionChangedEventArgs e)
{
    var s = e.Source as RadTileList;           
    var t = e.AddedItems.Count;
    if (t > 0)
    {
        windowManager.Alert("Testing", "This came from the Launcher: " + s.SelectedItem.ToString());
    }
}
Maya
Telerik team
 answered on 19 Apr 2013
1 answer
110 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
188 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
133 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
263 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
175 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
305 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
351 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
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?