Telerik Forums
UI for WPF Forum
6 answers
388 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
98 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
73 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
177 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
149 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
71 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
118 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
1 answer
142 views
Hi,

Can you please share sample code for printing WPF grid data using c#.
 
I tried the online demos avaliable at telerik site for GridView, it is showing "Example not supported in XBAP enviornment". I've tried silverlight code but showing errors.

Thanks,
-Narendra

Pavel Pavlov
Telerik team
 answered on 29 Sep 2010
3 answers
158 views
Is there a way to filter by nulls ?

Thanks !
Rossen Hristov
Telerik team
 answered on 29 Sep 2010
1 answer
104 views
Hello,

I am trying to display the row count on the raddatapager instead of footer. Is this possible? If so, is there an example somewhere?

Thank You in advance,
Kal
Rossen Hristov
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
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
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
SplashScreen
Rating
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
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?