Telerik Forums
UI for WPF Forum
2 answers
122 views
When I try to set the theme on the RadDocking class it crashes.  The error is "Element already has a logical parent.  It must be detached from the old parent before it is attached to a new one."  See the attached screen shot.

RadDocking Version: 2011.3.1116.40

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 Telerik.Windows.Controls;
using Telerik.Windows.Persistence.Services;
using Telerik.Windows.Persistence.Storage;
 
namespace BasicDockingPersistenceExample
{
 
    public partial class MainWindow : Window
    {
        private Theme _currentTheme = null;
        public MainWindow()
        {
              this.DataContext = new MainWindowViewModel();
 
            _currentTheme = new Office_SilverTheme();
            StyleManager.ApplicationTheme = _currentTheme;
 
            InitializeComponent();
          }
 
 
 
        private void RadButton_Click(object sender, RoutedEventArgs e)
        {
            _currentTheme = new Office_BlackTheme();
            StyleManager.ApplicationTheme = _currentTheme;
            Telerik.Windows.Controls.StyleManager.SetTheme(BuildDocking, _currentTheme);
        }
 
      }
}

<Window x:Class="BasicDockingPersistenceExample.MainWindow"
                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="MainWindow" Height="588" Width="876" Loaded="BuildDockingLoaded">
    <Window.Resources>
        <Style TargetType="{x:Type telerik:RadDocking}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
        <Style TargetType="{x:Type telerik:RadDockPanel}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
        <Style TargetType="{x:Type telerik:RadPane}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
        <Style TargetType="{x:Type telerik:RadPaneGroup}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
        <Style TargetType="{x:Type telerik:RadSplitContainer}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
        <Style TargetType="{x:Type telerik:ToolWindow}">
            <Setter Property="telerik:StyleManager.Theme" Value="{x:Static telerik:StyleManager.ApplicationTheme}"/>
        </Style>
 
    </Window.Resources>
    <telerik:RadDocking x:Name="BuildDocking" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                        Padding="2"  HasDocumentHost="False"
                        telerik:PersistenceManager.StorageId="BuildDocking">
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedBottom">
            <telerik:RadPaneGroup >
                <telerik:RadPane x:Name="Pane1Panel" Header="Pane 1"
                                 telerik:RadDocking.SerializationTag="Pane1Panel"
                                 IsPinned="{Binding Path=Pane1PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False">
 
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedLeft" >
            <telerik:RadPaneGroup  telerik:ProportionalStackPanel.RelativeSize="200, 300">
                <telerik:RadPane x:Name="Pane2Panel" Header="Pane 2"
                                 telerik:RadDocking.SerializationTag="Pane2Panel"
                                 IsPinned="{Binding Path=Pane2PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False">
                    <telerik:RadButton Content="Change Theme" Click="RadButton_Click" Height="30" VerticalAlignment="Top" Margin="10"/>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedRight" MinWidth="300">
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 3" x:Name="Pane3Panel"
                                 telerik:RadDocking.SerializationTag="Pane3Panel"
                                 IsPinned="{Binding Path=Pane3PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False" >
 
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedTop"  MinHeight="100" >
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 4" x:Name="Pane4Panel" 
                                 telerik:RadDocking.SerializationTag="Pane4Panel"
                                 IsPinned="{Binding Path=Pane4PanelIsPinned, Mode=TwoWay}"  CanUserClose="False" CanDockInDocumentHost="False" >
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedTop"  MinHeight="100" >
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 5" x:Name="Pane5Panel"
                                 telerik:RadDocking.SerializationTag="Pane5Panel"
                                 IsPinned="{Binding Path=Pane5PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False" >
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
 
    </telerik:RadDocking>
 
</Window>

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
 
namespace BasicDockingPersistenceExample
{
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        public MainWindowViewModel()
        {
             
        }
 
        #region DockPanel pinning properties
 
        private bool? _pane2PanelIsPinned = true;
 
        public bool? Pane2PanelIsPinned
        {
            get { return _pane2PanelIsPinned; }
            set
            {
                _pane2PanelIsPinned = value;
                FirePropertyChanged("Pane2PanelIsPinned");
            }
        }
 
        private bool? _pane1PanelIsPinned = false;
 
        public bool? Pane1PanelIsPinned
        {
            get { return _pane1PanelIsPinned; }
            set
            {
                _pane1PanelIsPinned = value;
                FirePropertyChanged("Pane1PanelIsPinned");
            }
        }
 
        private bool? _pane5PanelIsPinned = false;
 
        public bool? Pane5PanelIsPinned
        {
            get { return _pane5PanelIsPinned; }
            set
            {
                _pane5PanelIsPinned = value;
                FirePropertyChanged("Pane5PanelIsPinned");
            }
        }
 
        private bool? _pane3PanelIsPinned = true;
 
        public bool? Pane3PanelIsPinned
        {
            get { return _pane3PanelIsPinned; }
            set
            {
                _pane3PanelIsPinned = value;
                FirePropertyChanged("Pane3PanelIsPinned");
            }
        }
 
        private bool? _pane4PanelIsPinned = true;
 
        public bool? Pane4PanelIsPinned
        {
            get { return _pane4PanelIsPinned; }
            set
            {
                _pane4PanelIsPinned = value;
                FirePropertyChanged("Pane4PanelIsPinned");
            }
        }
 
        #endregion
 
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        protected void FirePropertyChanged(string property)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
 
    }
}






Trish
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
327 views
How do i remove the legend in the radchart.
I dont need it and it takes to much place !!
thx 
Petar Marchev
Telerik team
 answered on 20 Dec 2011
1 answer
77 views
I have discovered what I believe is a bug in PropertyGrid.

Here is a simplified explanation of the issue. 

I have a MainWindow that has a PropertyGrid that has its Item property bound to a CurrentWidget.  I have a ListBox that has its ItemSource bound to a Widgets collection and its SelectedItem bound to CurrentWidget (TwoWay).

I have a MainWindowViewModel that has a CurrentWidget property and a Widgets collection (Observable).

The Widget class just has four basic properties (ints, bools).

As you click through the Widgets in the ListBox (or arrow up/down), the properties of the selected widget are loaded into the PropertyGrid, but as you move through the items one less property is added to the PropertyGrid until the property count is zero and then it starts back at all of the properties and continues to work down to zero properties, etc. 

We have noticed that this is only happening when we have AutoGeneratePropertyDefinitions set to true (the default). 

I have created a small proof-of-concept application that isolates and illustrates the bug.  Please advise on how to get this to you guys.

Thanks in advance!
Ivan Ivanov
Telerik team
 answered on 20 Dec 2011
1 answer
254 views
Using the DockingCustomPropertyProvider I save the docking settings.  When I try to load them back up, (after I have unpinned a panel) I get the following error:  The given key was not present in the dictionary. 


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Telerik.Windows.Controls;
using Telerik.Windows.Persistence.Services;
 
namespace BasicDockingPersistenceExample
{
    public class DockingCustomPropertyProvider : ICustomPropertyProvider
    {
        public CustomPropertyInfo[] GetCustomProperties()
        {
            // Create two custom properties to serialize the Layout of the RadDocking and the Content of the RadPanes
            return new CustomPropertyInfo[]
                       {
                           new CustomPropertyInfo("Layout", typeof (string)),
                           new CustomPropertyInfo("Content", typeof (List<PaneProxy>)) {AllowCreateInstance = false, TreatAsUI = false},
                       };
        }
 
        public void InitializeObject(object context)
        {
        }
 
        public object InitializeValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            if (customPropertyInfo.Name == "Content")
            {
                // See remarks in ProvideValue method:
                // provide the values on which the saved properties will be restored upon
                RadDocking docking = context as RadDocking;
                List<PaneProxy> proxies = new List<PaneProxy>();
                foreach (RadPane pane in this.GetOrderedPanes(docking).ToArray())
                {
                    proxies.Add(new PaneProxy() { Content = pane.Content });
                }
                return proxies;
            }
            return null;
        }
 
        public object ProvideValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            RadDocking docking = context as RadDocking;
            if (customPropertyInfo.Name == "Layout")
            {
                // let the RadDocking save the layout of the Panes:
                return this.SaveLayoutAsString(docking);
            }
            else if (customPropertyInfo.Name == "Content")
            {
                // create proxies for all of the Panes and save their content
                IEnumerable<RadPane> panes = this.GetOrderedPanes(docking);
                List<PaneProxy> proxies = new List<PaneProxy>();
                foreach (RadPane pane in panes)
                {
                    proxies.Add(new PaneProxy() { Content = pane.Content });
                }
                return proxies;
            }
            return null;
        }
 
        public void RestoreValue(CustomPropertyInfo customPropertyInfo, object context, object value)
        {
            if (customPropertyInfo.Name == "Layout")
            {
                // let the RadDocking load the layout of the RadPanes
                this.LoadLayoutFromString(value.ToString(), context as RadDocking);
            }
            else if (customPropertyInfo.Name == "Content")
            {
                // the PersistenceManager does not re-create UI elements - in this case the Content of the RadPane.
                // So, instead of providing a value on which the saved properties will be applied,
                // we will use the InitializeValue method.
            }
        }
 
        private string SaveLayoutAsString(RadDocking instance)
        {
            MemoryStream stream = new MemoryStream();
            instance.SaveLayout(stream);
 
            stream.Seek(0, SeekOrigin.Begin);
 
            StreamReader reader = new StreamReader(stream);
            return reader.ReadToEnd();
        }
 
        private void LoadLayoutFromString(string xml, RadDocking instance)
        {
            using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
            {
                stream.Seek(0, SeekOrigin.Begin);
                instance.LoadLayout(stream);
            }
        }
 
        private IEnumerable<RadPane> GetOrderedPanes(RadDocking docking)
        {
            // get the RadPanes always in the same order:
            RadPane[] array = docking.Panes.ToArray();
            Array.Sort(array, new RadPaneComparer());
            return array;
        }
    }
 
    public class RadPaneComparer : IComparer<RadPane>
    {
        int IComparer<RadPane>.Compare(RadPane x, RadPane y)
        {
            // compare RadPanes by their serialization tag:
            string xSerializationTag = RadDocking.GetSerializationTag(x);
            string ySerializationTag = RadDocking.GetSerializationTag(y);
 
            return xSerializationTag.CompareTo(ySerializationTag);
        }
    }
 
    public class PaneProxy
    {
        public object Content { get; set; }
    }
}

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
 
namespace BasicDockingPersistenceExample
{
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        public MainWindowViewModel()
        {
             
        }
 
        #region DockPanel pinning properties
 
        private bool? _pane2PanelIsPinned = false;
 
        public bool? Pane2PanelIsPinned
        {
            get { return _pane2PanelIsPinned; }
            set
            {
                _pane2PanelIsPinned = value;
                FirePropertyChanged("Pane2PanelIsPinned");
            }
        }
 
        private bool? _pane1PanelIsPinned = false;
 
        public bool? Pane1PanelIsPinned
        {
            get { return _pane1PanelIsPinned; }
            set
            {
                _pane1PanelIsPinned = value;
                FirePropertyChanged("Pane1PanelIsPinned");
            }
        }
 
        private bool? _pane5PanelIsPinned = false;
 
        public bool? Pane5PanelIsPinned
        {
            get { return _pane5PanelIsPinned; }
            set
            {
                _pane5PanelIsPinned = value;
                FirePropertyChanged("Pane5PanelIsPinned");
            }
        }
 
        private bool? _pane3PanelIsPinned = true;
 
        public bool? Pane3PanelIsPinned
        {
            get { return _pane3PanelIsPinned; }
            set
            {
                _pane3PanelIsPinned = value;
                FirePropertyChanged("Pane3PanelIsPinned");
            }
        }
 
        private bool? _pane4PanelIsPinned = true;
 
        public bool? Pane4PanelIsPinned
        {
            get { return _pane4PanelIsPinned; }
            set
            {
                _pane4PanelIsPinned = value;
                FirePropertyChanged("Pane4PanelIsPinned");
            }
        }
 
        #endregion
 
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        protected void FirePropertyChanged(string property)
        {
            //Should only be called by ViewModel base class.  Derived classes should use lambda/LINQ syntax to simplify refactoring
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(property));
        }
 
    }
}

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 Telerik.Windows.Controls;
using Telerik.Windows.Persistence.Services;
using Telerik.Windows.Persistence.Storage;
 
namespace BasicDockingPersistenceExample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
 
            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(RadDocking), new DockingCustomPropertyProvider());
 
            this.DataContext = new MainWindowViewModel();
 
            InitializeComponent();
            Dispatcher.ShutdownStarted += new EventHandler(DispatcherShutdownStarted);
 
 
        }
 
        private void DispatcherShutdownStarted(object sender, EventArgs e)
        {
            Dispatcher.ShutdownStarted -= new EventHandler(DispatcherShutdownStarted);
            SaveLayout();
        }
 
 
        private void SaveLayout()
        {
            var storage = new IsolatedStorageProvider();
            storage.SaveToStorage();
 
        }
 
        private void LoadLayout()
        {
            var storage = new IsolatedStorageProvider();
            storage.LoadFromStorage();
        }
 
        private void BuildDockingLoaded(object sender, RoutedEventArgs e)
        {
            LoadLayout();
        }
 
 
    }
}

<Window x:Class="BasicDockingPersistenceExample.MainWindow"
                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="MainWindow" Height="588" Width="876">
    <telerik:RadDocking x:Name="BuildDocking" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                        Padding="2"  HasDocumentHost="False"
                        Loaded="BuildDockingLoaded"
                        telerik:PersistenceManager.StorageId="BuildDocking">
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedBottom">
            <telerik:RadPaneGroup >
                <telerik:RadPane x:Name="Pane1Panel" Header="Pane 1"
                                 telerik:RadDocking.SerializationTag="Pane1Panel"
                                 IsPinned="{Binding Path=Pane1PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False">
 
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedLeft" >
            <telerik:RadPaneGroup  telerik:ProportionalStackPanel.RelativeSize="200, 300">
                <telerik:RadPane x:Name="Pane2Panel" Header="Pane 2"
                                 telerik:RadDocking.SerializationTag="Pane2Panel"
                                 IsPinned="{Binding Path=Pane2PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False">
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedRight" MinWidth="300">
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 3" x:Name="Pane3Panel"
                                 telerik:RadDocking.SerializationTag="Pane3Panel"
                                 IsPinned="{Binding Path=Pane3PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False" >
 
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedTop"  MinHeight="100" >
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 4" x:Name="Pane4Panel" 
                                 telerik:RadDocking.SerializationTag="Pane4Panel"
                                 IsPinned="{Binding Path=Pane4PanelIsPinned, Mode=TwoWay}"  CanUserClose="False" CanDockInDocumentHost="False" >
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
        <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedTop"  MinHeight="100" >
            <telerik:RadPaneGroup >
                <telerik:RadPane Header="Pane 5" x:Name="Pane5Panel"
                                 telerik:RadDocking.SerializationTag="Pane5Panel"
                                 IsPinned="{Binding Path=Pane5PanelIsPinned, Mode=TwoWay}" CanUserClose="False" CanDockInDocumentHost="False" >
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
 
    </telerik:RadDocking>
 
</Window>
Trish
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
150 views
Hi,
I have a single data context and within my edmx model I have 2 tables.

Table 1 (Parent Table) (Loads grdSAPBatches)
AUFNR    Primary key
BATCH_Type
ENGINE_TYPE
START_DATE
START_TIME
PROGRAMMED_QTY

Table 2 (Child Table) (Loads grdSAPComponents)

 

AUFNR    FK1
TAG_POSITION FK2
COMPONENT
MESSAGE

I have a Grid and I have set as follows following the sample to show Table 1 data and on expand of row I would want to see filtered table 2 data with the relationship being AUFNR - but the child table seems to be ignoring the relationship I specified in xaml and just loading all the table 2 data?

I have changed self reference to False and True and it makes no difference....

The VB I am using to load the data is as follows

 

Dim vwSAPBatchesViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TblSAP_BatchesViewSource"), System.Windows.Data.CollectionViewSource)

vwSAPBatchesViewSource.Source = context.fnGetSapBatches

Child Table

Dim vwSAPComponentsViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TblSAP_ComponentsViewSource"), System.Windows.Data.CollectionViewSource)

vwSAPComponentsViewSource.Source = context.fnGetSapComponents

The bold items are the imports in edmx to SP's in sql server - neither fn's take parameters as I assumed the grid would filter the child data automatically once the relationship was set?

 

<Grid Margin="3" Grid.Column="1" Name="GridSAP">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <TextBlock x:Name="textBlock_Copy" TextWrapping="Wrap" Text="SAP Staging Table" FontFamily="Segoe UI" FontSize="13.333" VerticalAlignment="Center" FontStyle="Italic" Foreground="#FF969696" HorizontalAlignment="Center"/>
    <StackPanel x:Name="stkStaging" Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top"/>
    <telerik:RadGridView  ItemsSource="{Binding}" AutoGenerateColumns="False" x:Name="grdSAPBatches" DataContext="{StaticResource TblSAP_BatchesViewSource}" IsReadOnly="True" ShowGroupPanel="False" AlternateRowBackground="{x:Null}" Background="{x:Null}" ColumnBackground="#FF1E1E1E" Foreground="White" HorizontalGridLinesBrush="#FF323232" VerticalGridLinesBrush="#FF323232" RowIndicatorVisibility="Collapsed" BorderBrush="#FF0E0E0E" IsFilteringAllowed="False" CanUserFreezeColumns="False" ScrollViewer.CanContentScroll="True" VerticalAlignment="Top" d:LayoutOverrides="Width" Grid.Row="1" DataLoadMode="Asynchronous" HorizontalAlignment="Right" Style="{DynamicResource RadGridViewStyle_EPMS}"  GroupRowStyle="{DynamicResource GridViewGroupRowStyle_EPMS}" GroupPanelBackground="#FF0E0E0E">
        <telerik:RadGridView.ChildTableDefinitions>
            <telerik:GridViewTableDefinition>
                <telerik:GridViewTableDefinition.Relation>
                    <telerik:TableRelation IsSelfReference="False">
                        <telerik:TableRelation.FieldNames>
                            <telerik:FieldDescriptorNamePair ParentFieldDescriptorName="AUFNR" ChildFieldDescriptorName="AUFNR"/>
                        </telerik:TableRelation.FieldNames>
                    </telerik:TableRelation>
                </telerik:GridViewTableDefinition.Relation>
            </telerik:GridViewTableDefinition>
        </telerik:RadGridView.ChildTableDefinitions>
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn UniqueName="AUFNR" DataMemberBinding="{Binding AUFNR}" Header="Batch No." IsGroupable="False" IsFilterable="False"/>
            <telerik:GridViewDataColumn UniqueName="BATCH_TYPE" DataMemberBinding="{Binding BATCH_TYPE}" Header="Batch Type" IsGroupable="False" IsFilterable="False"/>
            <telerik:GridViewDataColumn UniqueName="ENGINE_TYPE" DataMemberBinding="{Binding ENGINE_TYPE}" Header="Part No." IsGroupable="False" IsFilterable="False"/>
            <telerik:GridViewDataColumn UniqueName="START_DATE" DataMemberBinding="{Binding START_DATE}" Header="Sched. Date" IsGroupable="False" IsFilterable="False"/>
            <telerik:GridViewDataColumn UniqueName="START_TIME" DataMemberBinding="{Binding START_TIME}" Header="Sched. Time" IsGroupable="False" IsFilterable="False"/>
            <telerik:GridViewDataColumn UniqueName="PROGRAMMED_QTY" DataMemberBinding="{Binding PROGRAMMED_QTY}" Header="Batch Qty" IsGroupable="False" IsFilterable="False"/>
        </telerik:RadGridView.Columns>
        <telerik:RadGridView.HierarchyChildTemplate>
            <DataTemplate>
                <telerik:RadGridView DataContext="{StaticResource TblSAP_ComponentsViewSource}" AutoGenerateColumns="False"  x:Name="grdSAPComponents" ItemsSource="{Binding}" ShowGroupPanel="False" AlternateRowBackground="{x:Null}" Background="{x:Null}" ColumnBackground="#FF1E1E1E" Foreground="White" HorizontalGridLinesBrush="#FF323232" VerticalGridLinesBrush="#FF323232" RowIndicatorVisibility="Collapsed" BorderBrush="#FF0E0E0E" IsFilteringAllowed="True" CanUserFreezeColumns="False" ScrollViewer.CanContentScroll="True" VerticalAlignment="Top" d:LayoutOverrides="Width" Grid.Row="1" DataLoadMode="Asynchronous" HorizontalAlignment="Right" Style="{DynamicResource RadGridViewStyle_EPMS}">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn UniqueName="AUFNR" DataMemberBinding="{Binding AUFNR}" Header="Batch No." IsGroupable="True" IsFilterable="True"/>
                        <telerik:GridViewDataColumn UniqueName="TAG_POSITION" DataMemberBinding="{Binding TAG_POSITION}" Header="Tag Position" IsGroupable="True" IsFilterable="True"/>
                        <telerik:GridViewDataColumn UniqueName="COMPONENT" DataMemberBinding="{Binding COMPONENT}" Header="Component" IsGroupable="True" IsFilterable="True"/>
                        <telerik:GridViewDataColumn UniqueName="HMI_MESSAGE" DataMemberBinding="{Binding HMI_MESSAGE}" Header="HMI Message" IsGroupable="True" IsFilterable="True"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
            </DataTemplate>
        </telerik:RadGridView.HierarchyChildTemplate>
          
    </telerik:RadGridView>
</Grid>


Any help much appreciated...

Andrew
Top achievements
Rank 1
 answered on 20 Dec 2011
1 answer
114 views
Hello,

I am attempting to theme two different RadDocking controls, within the same solution, each with its own custom theme. I have followed the instructions/example mentioned here and have been able to get the first theme applied. Is it possible to create a second theme to be applied to another RadDocking control?

I would also like to apply each theme in XAML, as demonstrated here in the RadDockingTheming Overview.

Thanks,
Frankie

Dani
Telerik team
 answered on 20 Dec 2011
1 answer
81 views
Hi,

I am working on a RadGridView with a Column Filter. For some columns it's a Combo Box with list of values and their description.
I would like to display the description into the Column Filter, instead of their underlying value, which is not very meaningful for the users.

How can we achieve this?

Thanks
Ric Yik
Dimitrina
Telerik team
 answered on 20 Dec 2011
1 answer
113 views
In an XBap application when a RadWindow is shown in the Application.StartUp event when there is no StartUri defined the RadWindow generates the exception listed. When the call to the RadWindow is removed or the StartUri is defined then the error goes away.

Version: 2011.3.1116.40 also tested with the latest internal build as of today.

<telerik:RadWindow x:Class="WpfBrowserApplication1.TestWindow"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" Header="TestWindow" Height="300" Width="300">
    <Grid Background="LightBlue">
        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
            Test
        </TextBlock>
    </Grid>
</telerik:RadWindow>

<Application x:Class="WpfBrowserApplication1.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Startup="Application_Startup" DispatcherUnhandledException="Application_DispatcherUnhandledException">
    <!-- StartupUri="Page1.xaml" -->
    <Application.Resources>
 
    </Application.Resources>
</Application>

using System.Windows;
 
namespace WpfBrowserApplication1
{
  using System;
 
  /// <summary>
  /// Interaction logic for App.xaml
  /// </summary>
  public partial class App : Application
  {
    public App()
    {
      AppDomain.CurrentDomain.UnhandledException += (s, a) => HandleError((Exception)a.ExceptionObject);
    }
 
    private object HandleError(Exception exception)
    {
      throw new NotImplementedException();
    }
 
    private void Application_Startup(object sender, StartupEventArgs e)
    {
      TestWindow newWindow = new TestWindow();
      newWindow.ShowDialog();
    }
 
    private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
    {
      Console.WriteLine();
    }
  }
}


Value cannot be null. Parameter name: adornedElement
   at System.Windows.Documents.Adorner..ctor(UIElement adornedElement)
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.WindowPopupAdorner..ctor(UIElement adornedElement, Panel contentPanel)
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.InitializeAdorner()
   at Telerik.Windows.Controls.InternalWindow.AdornerPopup.OnRootVisualLoaded(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.RouteItem.InvokeHandler(RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.EventRoute.InvokeHandlers(Object source, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.FrameworkElement.OnLoaded(RoutedEventArgs args)
   at MS.Internal.FrameworkObject.OnLoaded(RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedSynchronously(DependencyObject rootDO, Boolean isLoaded)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Miroslav Nedyalkov
Telerik team
 answered on 20 Dec 2011
1 answer
87 views
Hi
How to pin a column to right or left?
(Doesn't scroll left or right with scroll bar)

Thanks
Maya
Telerik team
 answered on 20 Dec 2011
0 answers
86 views
Hello to all
I have a application in windows c#.. I am having a wpf page in which i am using date picker(wpf control) and radgridview(telerik)..

when i make exe and runs on client's application and when i open that page  i am getting error
Plz see the attached file


Jack
Top achievements
Rank 1
 asked on 20 Dec 2011
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?