Telerik Forums
UI for WPF Forum
2 answers
125 views
Hi,

I have some functionality that sets up the grouping in a grid with some code. I create a GroupDescriptor and add it to the grid's GroupDescriptors. However, when I group this way, rather than by dragging a header into the group panel, the aggregate functions defined in my GridViewDataColumns are not applied. 

I'm guessing that I have to manually add all these aggregate functions to my group descriptor. However, I wanted to check if there is an easier way.

Thanks!
Geoff Smith
Top achievements
Rank 1
 answered on 30 Sep 2010
2 answers
153 views

I would need to use activeX control to open swf files inside application. It works without problems when doesn´t use RadDocking. But when I use RadDocking, activeX control won´t display.

I tried to use another ActiveX cntrols and it doesn´t work always when using RadDocking. Does anybody know please how to solve it?

My sample code:

MainWindow.xaml

<Window xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
        xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"       
        x:Class="TelerikDocking.MainWindow"
         
        Title="MainWindow" Height="350" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <telerikDocking:RadDocking Grid.Column="1"
                                   VerticalAlignment="Stretch"
                                   HorizontalAlignment="Stretch"
                                   telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
            <telerikDocking:RadDocking.DocumentHost>
                <telerikDocking:RadPaneGroup>
                    <telerikDocking:RadDocumentPane Header="Preview" x:Name="pane_preview_"  Title="Preview">
                        <Border x:Name="telerik_border"
                                BorderBrush="Black"
                                Background="Transparent"
                                ClipToBounds="True"
                                BorderThickness="1.5" />
                    </telerikDocking:RadDocumentPane>
                </telerikDocking:RadPaneGroup>
            </telerikDocking:RadDocking.DocumentHost>
            </telerikDocking:RadDocking>
         
            <Border x:Name="border" Grid.Column="0" />
    </Grid>
</Window>

MainWindow.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Forms.Integration;
using System.IO;
 
namespace TelerikDocking
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            WindowsFormsHost host = new WindowsFormsHost();
            FlashPlayer player = new FlashPlayer();
            player.LoadMovie(Directory.GetCurrentDirectory() + "\\00.swf");
            host.Child = player;
            border.Child = host;
 
            WindowsFormsHost host2 = new WindowsFormsHost();
            FlashPlayer player2 = new FlashPlayer();
            player.LoadMovie(Directory.GetCurrentDirectory() + "\\00.swf");
            host.Child = player2;
            telerik_border.Child = host2; 
        }
    }
}

FlashPlayer.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace TelerikDocking
{
    public partial class FlashPlayer : UserControl
    {
        public FlashPlayer()
        {
            InitializeComponent();
            axShockwaveFlash1.Dock = DockStyle.Fill;
            axShockwaveFlash1.IsAccessible = false;
            axShockwaveFlash1.EmbedMovie = false;
            axShockwaveFlash1.Playing = false;
        }
 
        public void LoadMovie(string strPath)
        {
            axShockwaveFlash1.LoadMovie(0, strPath);           
        }  
    }
}

Miroslav Nedyalkov
Telerik team
 answered on 30 Sep 2010
4 answers
216 views
Hello,

I am looking for the following functionality
I have two treeviews which are bound to two different collections. I want that when I drag the item from one treeview to another it (the item) should move to the other treeview in the hierarchy level I drop it to, with the drag effect .
Can this be achieved ?
Any code sample will be helpful.


Ryan Black
Top achievements
Rank 1
 answered on 29 Sep 2010
6 answers
412 views
How can I get the values of the row selected in the child grid of a hierachical grid.

My hierarchical GridView is bound to the results of an OData service:
ApprovalRequests
..Approvals

In a button click event I want to access the selected values.
Milan
Telerik team
 answered on 29 Sep 2010
1 answer
110 views
I have a RadtreeView that is already populated and a RadgridView on the same window. I want to drag a node from the tree to a particular (row/column) cell in the RadGridView. I have a few qiestions:

1 ----> Is this possible? (as I have not done this before)
2 ----> Should I be setting the whole grid to accept drops or just the cells individually?
3 ----> How do write the binding in the xaml if I am going to drop a treenode into the cell ?
4 ----> What are the major event handlers that I should be concerned with no both the tree side (while dragging the node) and the RadGrid side (while dropping the node) ?

Eagerly awaiting your reply. Thanks.
Tsvyatko
Telerik team
 answered on 29 Sep 2010
3 answers
81 views
Hi!

For a project I've to have a list where we can insert new element but never delete/edit previous elements.

Have you an idea about how to do this with the RadGridView?

Thank you :)
Nikolai Hellwig
Top achievements
Rank 1
 answered on 29 Sep 2010
2 answers
187 views
Hello,

I am new at telerik-controls and trying to show some grid entrys with details (master-entry-shema).
My project includes an ObservableCollection. The items of the ObservableCollection are shown in the GridView. The ObservableCollection includes another ObservableCollection that should be shown in the HierarchyChildTemplate. But that don't works.

XAML:
<Window x:Class="Grobplanung.Window1"
    xmlns:telctrl="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telnav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
    Title="Window1" Height="768" Width="1024" Loaded="Window_Loaded">
 
    <DockPanel LastChildFill="False">
        <telnav:RadToolBar Height="30" Name="radToolBar1"
                           DockPanel.Dock="Top"/>
        <telnav:RadMenu Name="radMenu1"
                        DockPanel.Dock="Top">
            <telerik:RadMenuItem Name="mnuDatei" Header="Datei">
                <telerik:RadMenuItem Name="mnuBeenden" Header="Beenden">
                </telerik:RadMenuItem>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="mnuBearbeiten" Header="Bearbeiten"/>
            <telerik:RadMenuItem Name="mnuExtras" Header="Extras"/>
            <telerik:RadMenuItem Name="mnuHilfe" Header="Hilfe"/>
        </telnav:RadMenu>
 
 
        <telerik:RadGridView Name="mainGV"
                             DockPanel.Dock="Top"
                             AutoGenerateColumns="False">
 
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
 
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>
 
 
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding VorgangsNr}"
                                            Header="Auftrags-Nr." />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding KundenNr}"
                                            Header="Kunden-Nr." />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Kundenname}"
                                            Header="Kundenname" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ArtikelNr}"
                                            Header="Artikel-Nr."/>
            </telerik:RadGridView.Columns>
 
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView ItemsSource="{Binding Details}" Name="childGrid" ShowGroupPanel="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Artikelbezeichnung}" Header="Artikelbezeichnung"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Auftragsart}" Header="Auftragsart"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
             
        </telerik:RadGridView>
    </DockPanel>
</Window>


class Auftragsdaten

class Auftragsdaten : INotifyPropertyChanged
 
{
    public Auftragsdaten()
    {
        Details = new ObservableCollection<Details>();
    }
 
    public ObservableCollection<Details> Details;
    public void AddDetails(string pArtikelbezeichnung, string pAuftragsart)
    {
        Details.Add(new Details() { Artikelbezeichnung = pArtikelbezeichnung, Auftragsart = pAuftragsart });
    }
...............


class Details

class Details
{
    public string Artikelbezeichnung;
    public string Auftragsart;
}


code behind the window

public partial class Window1 : Window
{
    private ObservableCollection<Auftragsdaten> _colDaten;
 
    public Window1()
    {
        InitializeComponent();
    }
 
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        _colDaten = new ObservableCollection<Auftragsdaten>();
 
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 1, ArtikelNr = "47110", KundenNr = "1000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 2, ArtikelNr = "47110", KundenNr = "1000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 3, ArtikelNr = "47113", KundenNr = "2000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 4, ArtikelNr = "47114", KundenNr = "2000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 5, ArtikelNr = "47115", KundenNr = "3000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 7, ArtikelNr = "47115", KundenNr = "3000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 8, ArtikelNr = "47115", KundenNr = "3000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 9, ArtikelNr = "47115", KundenNr = "4000", Kundenname = "Test" });
        _colDaten.Add(new Auftragsdaten() { VorgangsNr = 10, ArtikelNr = "47115", KundenNr = "4000", Kundenname = "Test" });
 
        _colDaten[0].AddDetails("Staubsauger 3744", "Barverkauf");
        _colDaten[0].AddDetails("Mixer 2231", "Barverkauf");
        _colDaten[0].AddDetails("Toaster 112", "Barverkauf");
 
        _colDaten[1].AddDetails("Staubsauger 3744", "Barverkauf");
        _colDaten[1].AddDetails("Mixer 2231", "Barverkauf");
        _colDaten[1].AddDetails("Toaster 112", "Barverkauf");
 
        this.mainGV.ItemsSource = _colDaten;
    }
}


Can you please help me?
Markus
Top achievements
Rank 1
 answered on 29 Sep 2010
1 answer
172 views
Using the latest WPF build, I am now having a problem in the designer:

System.IO.FileLoadException

Could not load file or assembly 'Telerik.Windows.Controls, Version=2010.2.917.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at MS.Internal.Package.VSIsolationProviderService.RemoteReferenceProxy.VsReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.CachingReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.Microsoft.Windows.Design.Metadata.IReflectionResolver.GetRuntimeAssembly(Assembly reflectionAssembly) at MS.Internal.Metadata.ClrAssembly.GetRuntimeMetadata(Object reflectionMetadata) at Microsoft.Windows.Design.Metadata.AttributeTableContainer.<MergeAttributesIterator>d__c.MoveNext() at Microsoft.Windows.Design.Metadata.AttributeTableContainer.GetAttributes(Assembly assembly, Type attributeType, Func`2 reflectionMapper) at MS.Internal.Metadata.ClrAssembly.GetAttributes(ITypeMetadata attributeType) at MS.Internal.Design.Metadata.Xaml.XamlAssembly.get_XmlNamespaceCompatibilityMappings() at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata sourceAssembly) at Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetXmlNamespaceCompatibilityMappings(IAssemblyMetadata source) at MS.Internal.Design.Metadata.ReflectionProjectNode.BuildSubsumption() at MS.Internal.Design.Metadata.ReflectionProjectNode.SubsumingNamespace(Identifier identifier) at MS.Internal.Design.Markup.XmlElement.BuildScope(PrefixScope parentScope, IParseContext context) at MS.Internal.Design.Markup.XmlElement.ConvertToXaml(XamlElement parent, PrefixScope parentScope, IParseContext context, IMarkupSourceProvider provider) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.FullParse(Boolean convertToXamlWithErrors) at MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.get_RootItem() at Microsoft.Windows.Design.DocumentModel.Trees.ModifiableDocumentTree.get_ModifiableRootItem() at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.get_LoadState() at MS.Internal.Host.PersistenceSubsystem.Load() at MS.Internal.Host.Designer.Load() at MS.Internal.Designer.VSDesigner.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load() at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view) at MS.Internal.Host.Isolation.IsolatedDesigner.Load() at MS.Internal.Designer.DesignerPane.LoadDesignerView()

---------------
It appears that VS is trying to load some dependent assembly from the web?
Milan
Telerik team
 answered on 29 Sep 2010
1 answer
77 views
Hi,

I'm using MVVM auto binding to create a Bar Chart

in my xaml,

 

<telerikChart:RadChart Width="200" Height="200" ItemsSource="{Binding DisplayedCapacitySeries}" Padding="3">
.... 
 <telerik:SeriesMapping.ItemMappings>  
    <telerik:ItemMapping DataPointMember="YValue" FieldName="Capacity_TB"/>   
     <telerik:ItemMapping DataPointMember="XCategory" FieldName="CapacityName" />   
 </telerik:SeriesMapping.ItemMappings>


The chart was created at the first loading. However, the Chart is not refreshed when Caparity_TB is changed although INotifyPropertyChanged is implemented in the ViewModel class. 

Also I want to show the legend with the CapacityName. I'm using LegendDisplayMode="DataPointLabel". However, the legend shows as "item 0 .. item 1" instead of the CapacityName on the XCategory.

Also how can I hide the legend header?
 

 


Thanks,
Ves
Telerik team
 answered on 29 Sep 2010
1 answer
126 views

Hello,

I have a WPF application which incorporates the MVVM pattern. I have a viewmodel class which basically has two properties:

01.private SeriesMappingCollection _mapCollection;
02.private ArrayList _joints;

03.public SeriesMappingCollection MapCollection
04.{
05.    get { return _mapCollection; }
06.    set
07.    {
08.         if (_mapCollection != value)
09.         {
10.              _mapCollection = value;
11.              OnPropertyChanged("MapCollection");
12.         }              
13.     }
14.}      
15.  
16.public ArrayList Joints
17.{
18.     get { return _joints; }
19.     set
20.     {
21.           if (_joints != value)
22.           {
23.               _joints = value;
24.               OnPropertyChanged("Joints");
25.           }
26.      
27.}


The values of Mapcollection and Joints are set using a BackgroundWorker. When the data has been fetched, the GetAlertCompleted function is fired and the Mapcollection and Joints properties are set. This consequently fires the OnPropertyChanged() function of the view model 

01.public ViewModel()
02.{
03.       workerAlerts = new BackgroundWorker();
04.       workerAlerts.DoWork += (o, args) => args.Result = 
05.           VizBackend.GetAlert.(_ipAdd,_selectedPeriod);
06.              
07.       workerAlerts.RunWorkerCompleted += GetAlertCompleted;
08.}
09.  
10.private void GetAlertCompleted(object sender, RunWorkerCompletedEventArgs e)
11.{
12.  
13.     var alertData = e.Result as AlertData;
14.     Joints = alertData.Joints;
15.     MapCollection = alertData.MapCollection;
16. }

And in the main window I have:

01.private readonly ViewModel vm;
02.vm = (ViewModel)DataContext;
03.vm.PropertyChanged += VmPropertyChanged;
04.  
05.private void VmPropertyChanged(object sender, PropertyChangedEventArgs e)
06.        {
07.            switch (e.PropertyName)
08.            {
09.                case "MapCollection":
10.                    this.radChart.SeriesMappings = vm.MapCollection;
11.                    break;
12.  
13.                case "Joints":
14.                    this.radChart.ItemsSource = vm.Joints;
15.                    break;
16.            }
17.        }
The problem is that when I assign the first property of the RadChart ( for example ItemsSource), I cant set the SeriesMappings property and I receive this error "The calling thread cannot access this object because a different thread owns it". I have no idea why this error is being raised. If I can set one property, why cant I set the second one. And it also doesnt matter in which order they are assigned. Once the first is assigned, I get an error for the second one. 


I would appreciate if you could point out where the problem might be. Thanks.


Yavor
Telerik team
 answered on 29 Sep 2010
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
DataPager
PersistenceFramework
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?