Telerik Forums
UI for WPF Forum
9 answers
2.2K+ views
I have been developing an application in WPF using the RadControls for WPF trial version (2009 Q3 I think) over the last few months. Just last week I was able to purchase the RadControls suite and installed them on my machine. Everything has been working fine, even as early as this morning, until this afternoon. For some unexplained reason, my main window no longer appears at design time. By trial and error, I have narrowed the problem down to the inclusion of the references to Telerik.Windows.Controls, Telerik.Windows.Controls.Navigation, and Telerik.Windows.Data. Removing these references and code that requires them resolves the issue.

To test this, I created a new project (WPF application) in VS2008. The application built and ran without me making any modifications to it. Then, I added the references listed above and attempted to run it again. The application runs, but at design time the main window Window1.xaml is not displayed. Instead, I get the following exception information:

Exception has been thrown by the target of an invocation.

at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType) at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at Microsoft.Windows.Design.Features.FeatureManager.FeatureConnectorEntry.AttemptActivate() at Microsoft.Windows.Design.Features.FeatureManager.FeatureConnectorEntry.OnRequirementsChanged(Object sender, EventArgs e) at Microsoft.Windows.Design.RequirementValidator.OnRequirementChanged(Object sender, EventArgs e) at Microsoft.Windows.Design.RequirementSubscription.OnRequirementChanged() at Microsoft.Windows.Design.RequiresContextItemAttribute.RequireContextItemSubscription.OnContextItemChanged(ContextItem item) at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value) at Microsoft.Windows.Design.Interaction.DesignerView.set_Context(EditingContext value) at MS.Internal.Designer.SimpleViewManager.get_View() at Microsoft.Windows.Design.Documents.MarkupDocumentManager.get_View() at MS.Internal.Host.PersistenceSubsystem.get_DocumentView() at MS.Internal.Host.Designer.get_View() 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()

Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.Windows.Input.Cursor'.

at MS.Internal.Interaction.DesignerResources.GetCursor(ResourceKey key) at MS.Internal.GridControl.GridPanelAdorner..ctor(Grid grid) at MS.Internal.GridControl.GridDesigner..ctor(ModelItem gridItem) at MS.Internal.GridControl.GridDesigner.GetDesigner(ModelItem gridItem) at MS.Internal.GridControl.AlwaysVisibleGridAdornersProvider.Activate(ModelItem item, DependencyObject view) at Microsoft.Windows.Design.Interaction.AdornerProvider.InvokeActivate(EditingContext context, ModelItem item, DependencyObject view) at MS.Internal.Features.AdornerProviderFeatureConnector.FeatureProvidersAdded(ModelItem item, IEnumerable`1 extensions) at Microsoft.Windows.Design.Features.PolicyDrivenFeatureConnector`1.UpdateFeatureProviders() at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1.UpdateCurrentTool(Tool newTool) at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1.<.ctor>b__0(Tool newTool) at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.Subscribe(Type contextItemType, SubscribeContextCallback callback) at Microsoft.Windows.Design.ContextItemManager.Subscribe[ContextItemType](SubscribeContextCallback`1 callback) at MS.Internal.Features.PolicyDrivenToolFeatureConnector`1..ctor(FeatureManager manager) at MS.Internal.Features.AdornerProviderFeatureConnector..ctor(FeatureManager manager)

Again, I did NOTHING to this project except add the references to it. Removing the references causes the exception to disappear and the window is displayed at design time as expected.

This exception is a little different from the exception I get in my other application, which contains two nested RadTabControls. Here is that exception:

System.Windows.Markup.XamlParseException occurred
  Message="'/Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. '/Telerik.Windows.Controls.Navigation;component/themes/vista/CarouselDataFieldPresenter.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object.  Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml'.  Error at object 'System.Windows.ResourceDictionary'."
  Source="PresentationFramework"
  LineNumber=0
  LinePosition=0
  NameContext="MergedDictionaries"
  StackTrace:
       at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
       at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
       at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
       at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
       at System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(Boolean isTraceEnabled)
       at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
       at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
       at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
       at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
       at System.Windows.FrameworkElement.OnThemeStyleKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.FrameworkElement.set_DefaultStyleKey(Object value)
       at Telerik.Windows.Controls.RadTabControl.SetDefaultStyleKey()
       at Telerik.Windows.Controls.RadTabControl.ResetTheme()
       at Telerik.Windows.Controls.StyleManager.OnThemeChanged(DependencyObject target, DependencyPropertyChangedEventArgs changedEventArgs)
       at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
       at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.Markup.BamlRecordReader.SetDependencyValueCore(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
       at System.Windows.Markup.BamlRecordReader.SetDependencyValue(DependencyObject dependencyObject, DependencyProperty dependencyProperty, Object value)
       at System.Windows.Markup.BamlRecordReader.SetPropertyValue(Object o, PropertyDefinition propertyDefinition, Object value)
       at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
       at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
       at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
       at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
       at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
       at System.Windows.Markup.TreeBuilder.Parse()
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Fluke.Utilities.ProductConfig.ProductionAssistant.InitializeComponent() in t:\VS2008\ProductionAssistant\ProductionAssistant\ProductionAssistant.xaml:line 1
       at Fluke.Utilities.ProductConfig.ProductionAssistant..ctor() in T:\VS2008\ProductionAssistant\ProductionAssistant\ProductionAssistant.xaml.cs:line 16
  InnerException: System.Windows.Markup.XamlParseException
       Message="'/Telerik.Windows.Controls.Navigation;component/themes/vista/CarouselDataFieldPresenter.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object.  Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.Windows.Controls.Navigation;component/Themes/GenericVista.xaml'."
       Source="PresentationFramework"
       LineNumber=0
       LinePosition=0
       NameContext="MergedDictionaries"
       StackTrace:
            at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
            at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
            at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
            at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
            at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
            at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
            at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
            at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
            at System.Windows.Markup.TreeBuilder.Parse()
            at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
            at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
            at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
            at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
            at System.Windows.ResourceDictionary.set_Source(Uri value)
       InnerException: System.NullReferenceException
            Message="Object reference not set to an instance of an object."
            Source="PresentationFramework"
            StackTrace:
                 at System.Windows.Markup.XmlnsCache.GetClrnsToAssemblyNameMappingList(Assembly[] asmList, String xmlnsRequested)
                 at System.Windows.Markup.XmlnsCache.GetMappingArray(String xmlns)
                 at System.Windows.Markup.XamlTypeMapper.GetClrNamespacePairFromCache(String namespaceUri)
                 at System.Windows.Markup.XamlTypeMapper.GetNamespaceMapEntries(String xmlNamespace)
                 at System.Windows.Markup.XamlTypeMapper.CreateTypeAndSerializer(String xmlNamespace, String localName)
                 at System.Windows.Markup.XamlTypeMapper.GetTypeOnly(String xmlNamespace, String localName)
                 at System.Windows.Markup.XamlTypeMapper.GetType(String xmlNamespace, String localName)
                 at System.Windows.Markup.XamlTypeMapper.GetTypeFromBaseString(String typeString, ParserContext context, Boolean throwOnError)
                 at System.Windows.Markup.ProvideValueServiceProvider.System.Windows.Markup.IXamlTypeResolver.Resolve(String qualifiedTypeName)
                 at System.Windows.Markup.TypeTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
                 at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
                 at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
                 at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
                 at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
                 at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
                 at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
                 at System.Windows.Markup.BamlRecordReader.BaseReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord, ArrayList& defKeyList, List`1& staticResourceValuesList)
                 at System.Windows.Markup.BamlRecordReader.ReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord)
                 at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
                 at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
                 at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
                 at System.Windows.Markup.TreeBuilder.Parse()
                 at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
                 at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
                 at MS.Internal.AppModel.AppModelKnownContentFactory.BamlConverter(Stream stream, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
                 at MS.Internal.AppModel.MimeObjectFactory.GetObjectAndCloseStream(Stream s, ContentType contentType, Uri baseUri, Boolean canUseTopLevelBrowser, Boolean sandboxExternalContent, Boolean allowAsync, Boolean isJournalNavigation, XamlReader& asyncObjectConverter)
                 at System.Windows.ResourceDictionary.set_Source(Uri value)
            InnerException:

This application will only display the main window at design time if I remove the references I mentioned above. Even removing all of the RadTabControl XAML code does not allow the window to be displayed if the references are still included.

The only odd thing I remember seeing immediately before this started happening was a green balloon appearing on the Telerik menu in VS2008 indicating there was an upgrade available and asking if I wanted to upgrade my project. I ignored the message because I did not want to affect my project until I reached a point where I could deal with that by itself. After this exception started to occur, I tried running the upgrade to see if that would resolve the problem, but it did not. I also uninstalled ALL Telerik WPF controls from my machine and re-installed the 2010_0309_DEV version. (JustCode is also installed on my machine)

Here is my XAML code for the window that will not load in the designer:

<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
    x:Class="Fluke.Utilities.ProductConfig.ProductionAssistant" 
    xmlns:local="clr-namespace:Fluke.Utilities.ProductConfig"   
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" 
    Title="Production Assistant" MinWidth="640" MinHeight="600" 
    Background="{DynamicResource WindowBackgroundGradient}"   
    SizeToContent="WidthAndHeight" WindowStyle="ThreeDBorderWindow" > 
 
    <Window.Resources> 
        <DataTemplate x:Key="groupsHeader">  
            <StackPanel Orientation="Horizontal">  
                <Image Source="{Binding Path=Image}" Margin="3" Height="32" Width="32"/>  
                <TextBlock Text="{Binding Path=Name}" Foreground="Black" Margin="3" VerticalAlignment="Center"/>  
            </StackPanel> 
        </DataTemplate> 
 
        <DataTemplate x:Key="productsHeaders">  
            <StackPanel x:Name="spProductTabHeader" Orientation="Vertical">  
                <TextBlock Text="{Binding Path=BaseModel}" Margin="3" VerticalAlignment="Center"/>  
                <Image Source="{Binding Path=Image}" Margin="3" Height="32" Width="32"/>  
            </StackPanel> 
        </DataTemplate> 
 
        <DataTemplate x:Key="productsContent">  
            <ContentControl Content="{Binding Path=UserInterface}"/>  
        </DataTemplate> 
 
        <DataTemplate x:Key="groupsContent">  
            <StackPanel Orientation="Vertical">  
                <StackPanel Orientation="Horizontal">  
                    <TextBlock Margin="10,10,2,10" FontSize="14" FontWeight="Bold" Text="Choose a"/>  
                    <TextBlock Margin="2,10,2,10" FontSize="14" FontWeight="Bold" Text="{Binding Path=Name}"/>  
                    <TextBlock Margin="2,10,10,10" FontSize="14" FontWeight="Bold" Text="product from the tabs below:"/>  
                </StackPanel> 
                <telerikNavigation:RadTabControl TabStripPlacement="Left" TabOrientation="Horizontal" x:Name="tabProducts"   
                        Margin="5" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" telerik:StyleManager.Theme="Windows7" ScrollMode="Item" 
                        MinHeight="250" MaxHeight="480" MinWidth="400" 
                        ItemsSource="{Binding Path=Products, Mode=OneTime}" 
                        SelectedItem="{Binding Path=SelectedProduct, Mode=TwoWay}" 
                        ItemTemplate="{StaticResource productsHeaders}" 
                        ContentTemplate="{StaticResource productsContent}">  
                </telerikNavigation:RadTabControl> 
            </StackPanel> 
        </DataTemplate> 
    </Window.Resources> 
 
 
    <Grid x:Name="grid">  
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto" /> 
            <RowDefinition Height="Auto" /> 
            <RowDefinition Height="Auto" /> 
            <!--<RowDefinition Height="Auto" />--> 
        </Grid.RowDefinitions> 
 
        <Menu Grid.Row="0">  
            <MenuItem Header="_File">  
                <MenuItem x:Name="ExitApplication" Header="Exit"></MenuItem> 
            </MenuItem> 
            <MenuItem Header="_Tools">  
                <MenuItem x:Name="ImportMACAddresses" Header="Import MAC Addresses from File..."/>  
                <MenuItem x:Name="ImportOrders" Header="Import Order Info from File..."/>  
                <MenuItem x:Name="ImportFinalDestinations" Header="Import Final Destination Records from FoxPro..."/>  
                <MenuItem x:Name="ImportProductConfigurations" Header="Import Product Configurations from Spreadsheet..."/>  
                <MenuItem x:Name="ReassignSerialNumber" Header="Reassign Serial Number..."/>  
                <MenuItem x:Name="ShowOptions" Header="Options"/>  
            </MenuItem> 
            <MenuItem Header="_Help">  
                <MenuItem x:Name="mnuAbout" Header="_About"></MenuItem> 
            </MenuItem> 
        </Menu> 
 
        <StackPanel Grid.Row="1" > 
            <TextBlock Margin="5" FontWeight="Bold" FontStyle="Italic" FontSize="24" Text="Production Assistant"/>  
        </StackPanel> 
 
        <telerikNavigation:RadTabControl x:Name="tabGroups" Grid.Row="2" MinHeight="250" 
                                         Margin="5" VerticalAlignment="Stretch"   
                                         HorizontalAlignment="Stretch" telerik:StyleManager.Theme="Windows7" ScrollMode="Item" 
                                         SelectedItem="{Binding Path=SelectedGroup, Mode=TwoWay}" 
                                         ItemsSource="{Binding Path=Groups}" SelectedIndex="0" 
                                         ItemTemplate="{StaticResource groupsHeader}" 
                                         ContentTemplate="{StaticResource groupsContent}"/>  
 
        <!--<DockPanel Grid.Row="3" LastChildFill="True" > 
            <TextBlock DockPanel.Dock="Top" Margin="2">Status:</TextBlock> 
            <ListView DockPanel.Dock="Top" Name="lvStatus" Margin="2" MinHeight="50" ItemsSource="{Binding Path=Feedback, NotifyOnTargetUpdated=True}" TargetUpdated="lvStatus_TargetUpdated"/>  
        </DockPanel>--> 
    </Grid> 
</Window> 
 



denis curtis
Top achievements
Rank 1
 answered on 26 Mar 2010
7 answers
769 views
Hi,
I have a data object that implements INotifyDataErrorInfo.
Unfortunately the support for this in RadGridView is still flaky and there are some visual problems so i am using my own custom style to control validations.

I turned off validation binding but this seems to only solve half my problem.
I now have the following problem - whenever i try to edit a cell that has validation errors i cannot leave the cell unless i press Esc.
Our application flow permits validation errors to exist so the user should not be forced to correct an error before they can move on to something else.

So my question is : how do i turn off editing validation? 

Thanks,
Yossi.
Nedyalko Nikolov
Telerik team
 answered on 26 Mar 2010
1 answer
132 views
Hi, Telerik!

I need your help.

I want to binding a string list like ObservableCollection<string> to a GridViewComboBoxColumn, but failed.

while I add a new row in Gridview, the GridViewComboBoxColumn cannot display any data.

I use the version of 2009 Q3.

Wish your help, thank you!
Maya
Telerik team
 answered on 26 Mar 2010
3 answers
77 views
I have the below xaml code, when I tried to drap and drop the Food Categories to anywhere under the Sports Categories, the Pizza and Pasta sub items lost their left indent under the Food Categoeis. Basically, what I mean is when I drap and drop one root level of treeview item to anywhere under another treeview root item, the layout turned out to be not as expected.

Below is my code, could you please try what I described above and see that happens? Thanks.

<

 

Window x:Class="TreeView.Window1"

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

Title="Window1" Height="500" Width="800"

 

 

xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation">

 

 

 

<Grid>

 

 

 

<telerikNavigation:RadTreeView Margin="46,54,32,108" Name="radTreeView1" IsTriStateMode="False" IsDragDropEnabled="True" IsEditable="True">

 

 

 

<telerikNavigation:RadTreeViewItem Header="Sport Categories">

 

 

 

<telerikNavigation:RadTreeViewItem Header="Football">

 

 

 

<telerikNavigation:RadTreeViewItem Header="Futsal"/>

 

 

 

<telerikNavigation:RadTreeViewItem Header="Soccer"/>

 

 

 

</telerikNavigation:RadTreeViewItem>

 

 

 

<telerikNavigation:RadTreeViewItem Header="Tennis"/>

 

 

 

<telerikNavigation:RadTreeViewItem Header="Cycling"/>

 

 

 

</telerikNavigation:RadTreeViewItem>

 

 

 

<telerikNavigation:RadTreeViewItem Header="Food Categories">

 

 

 

<telerikNavigation:RadTreeViewItem Header="Pizza"/>

 

 

 

<telerikNavigation:RadTreeViewItem Header="Pasta"/>

 

 

 

</telerikNavigation:RadTreeViewItem>

 

 

 

</telerikNavigation:RadTreeView>

 

 

 

</Grid>

 

</

 

Window>

 



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;

 

namespace

 

TreeView

 

{

 

/// <summary>

 

 

/// Interaction logic for Window1.xaml

 

 

/// </summary>

 

 

public partial class Window1 : Window

 

{

 

public Window1()

 

{

InitializeComponent();

}

}

}

wpfdev
Top achievements
Rank 1
 answered on 26 Mar 2010
1 answer
81 views
When I am adding the XAxis tickpoint  , if the tickpoint count increased by 15 then Array out of index exception has thrown

radChart.DefaultView.ChartArea.AxisX.TickPoints[index].Label =Date;
When the index value increased by 15 then it will throw the Array out of index exception

Velin
Telerik team
 answered on 26 Mar 2010
5 answers
358 views
Hi!

I would like to change the with of the space between panes in a RadSplitContainer, the resizer. There is a styling sample which changes the color of the right sizer, but I want to change the widht / height. How do I do this?

Regards,
Lennart
Pana
Telerik team
 answered on 26 Mar 2010
1 answer
105 views
The gridview can't visible the gridviewcell correctly when I scorll the scorllViewer in gridview . 
 GridViewRow s = ((GridViewRow)RadGridView1.ItemContainerGenerator.ContainerFromIndex(0));  
            if (s != null)  
            {  
                 GridViewCellBase       j =  
                       (from c in s.Cells where c.Column.Name == "email" select c).FirstOrDefault();  
                 if (j != null)  
                 {  
                     j.Visibility = Visibility.Hidden;  
                 }  
            } 
the first pictrue is before scrolling,and the second one is after scrolling 
Vlad
Telerik team
 answered on 26 Mar 2010
3 answers
258 views
Hi,

I have a grid defined like this:

<Controls:RadGridView ItemsSource="{Binding Path=DishTypes}" ShowGroupPanel="False" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserFreezeColumns="False" 
                                      AutoGenerateColumns="False" RowDetailsVisibilityMode="Visible" IsReadOnly="True" ShowColumnHeaders="False"  
                                      RowIndicatorVisibility="Collapsed" GridLinesVisibility="Horizontal"
                    <Controls:RadGridView.ChildTableDefinitions> 
                        <Controls:GridViewTableDefinition /> 
                    </Controls:RadGridView.ChildTableDefinitions> 
                    <Controls:RadGridView.Columns> 
                        <Controls:GridViewComboBoxColumn DataMemberBinding="{Binding Path=Id}"  
                                                         DisplayMemberPath="Name"  
                                                         SelectedValueMemberPath="Id"  
                                                         ItemsSource="{Binding Source={StaticResource dishTypeData}}" />  
                    </Controls:RadGridView.Columns> 
                    <Controls:RadGridView.HierarchyChildTemplate> 
                        <DataTemplate> 
                            <Controls:RadGridView ItemsSource="{Binding Path=MenuItems}" ShowGroupPanel="False" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserFreezeColumns="False" 
                                                  AutoGenerateColumns="False" RowDetailsVisibilityMode="Visible" IsReadOnly="False" ShowColumnHeaders="False"  
                                                  RowIndicatorVisibility="Collapsed" GridLinesVisibility="Horizontal"
                                <Controls:RadGridView.Columns> 
                                    <Controls:GridViewComboBoxColumn DataMemberBinding="{Binding Path=FoodId}"  
                                                                     ItemsSource="{Binding Source={StaticResource foodData}}" 
                                                                     DisplayMemberPath="Name" 
                                                                     SelectedValueMemberPath="Id" /> 
                                    <Controls:GridViewDataColumn DataMemberBinding="{Binding Path=PortionSize}" /> 
                                </Controls:RadGridView.Columns> 
                            </Controls:RadGridView> 
                        </DataTemplate> 
                    </Controls:RadGridView.HierarchyChildTemplate> 
                </Controls:RadGridView> 


What  is the property to make all the tree children expanded (similar to clicking the + sign on all) ?

Thank you,
Calin
Vlad
Telerik team
 answered on 25 Mar 2010
1 answer
181 views
Hello,
I would like to know how to set 2 groups in a radgridview adding 3 sum functions in the second group.
I must admit I cannot do it....
Thanks a lot....

Nick

For better details what I try to do is in the following code

<telerik:RadGridView x:Name="radGridInvoiceDetails" ShowGroupPanel="False" AutoGenerateColumns="False" Height="245" Width="920" ItemsSource="{Binding}" HorizontalAlignment="Center" DataLoadMode="Asynchronous">  
    <telerik:RadGridView.Columns> 
        <telerik:GridViewDataColumn Header="ProductFamily" DataMemberBinding="{Binding ProductFamilyDescription}" IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="Auto" IsVisible="False"/>  
        <telerik:GridViewDataColumn Header="Prodotto"      DataMemberBinding="{Binding ProductDescription}"       IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="Auto" IsVisible="False"/>  
        <telerik:GridViewDataColumn Header="Numero"        DataMemberBinding="{Binding BillNumberString}"         IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="50" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Data"          DataMemberBinding="{Binding BillDate}"                 IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="50" DataFormatString="{}{0:dd/MM/yyyy}"/>  
        <telerik:GridViewDataColumn Header="Qta"           DataMemberBinding="{Binding ProductQuantity}"          IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="50" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Prz.Uni"       DataMemberBinding="{Binding ProductFee}"               IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="50" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Tot.Prod"      DataMemberBinding="{Binding ProductTotal}"             IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Scontato"      DataMemberBinding="{Binding ProductDiscountedTotal}"   IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Trasporto"     DataMemberBinding="{Binding TransportTotal}"           IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Scontato"      DataMemberBinding="{Binding TransportDiscountedTotal}" IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Sconto totale" DataMemberBinding="{Binding TotalDiscountAmount}"      IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Imponibile"    DataMemberBinding="{Binding TotalBill}"                IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="75" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="IVA"           DataMemberBinding="{Binding VATString}"                IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="50"                             TextAlignment="Right"/>  
        <telerik:GridViewDataColumn Header="Totale"        DataMemberBinding="{Binding TotalVAT}"                 IsReadOnly="True" IsFilterable="False" HeaderTextAlignment="Center" Width="100" DataFormatString="{}{0:N2}" TextAlignment="Right"/>  
        <telerik:GridViewDataColumn x:Name="columnView" IsFilterable="False" IsSortable="False" Width="40" IsReadOnly="True">  
            <telerik:GridViewColumn.CellTemplate> 
                <DataTemplate> 
                    <telerik:RadButton x:Name="buttonView" Click="buttonView_Click" Background="White" BorderBrush="White" Loaded="buttonView_Loaded">  
                        <Image Height="20" Width="20" Source="/Raise.FarinaEzio.SIB.Client.Management.GUI.BusinessManagement.Controls;component/Images/Edit.png"/>  
                        <Button.ToolTip> 
                            <StackPanel Orientation="Horizontal">  
                                <Image Source="/Raise.FarinaEzio.SIB.Client.Management.GUI.BusinessManagement.Controls;component/Images/Edit.png"/>  
                                <Label Content="Visualizza la bolla"/>  
                            </StackPanel> 
                        </Button.ToolTip> 
                    </telerik:RadButton> 
                </DataTemplate> 
            </telerik:GridViewColumn.CellTemplate> 
        </telerik:GridViewDataColumn> 
    </telerik:RadGridView.Columns> 
    <!--<telerik:RadGridView.GroupDescriptors> 
        <telerik:GroupDescriptor Member="ProductFamilyDescription" SortDirection="Ascending"/>  
        <telerik:GroupDescriptor Member="ProductDescription" SortDirection="Ascending" /> 
    </telerik:RadGridView.GroupDescriptors>--> 
</telerik:RadGridView> 
 

in the radgridview of this XAML code I have to programmatically add two groups,the second of which must also make 3 sum funtions.
Following examples I have found in this site I have written this code

private void InitInvoiceDetails()  
{  
    try 
    {  
        radGridInvoiceDetails.SelectedItem = null;  
        radGridInvoiceDetails.ItemsSource = null;  
        radGridInvoiceDetails.GroupDescriptors.Clear();  
 
        if (CurrentMaster != null)  
        {  
            var collection = from d in dc.InvoiceDetails  
                             where d.IdInvoiceMaster == CurrentMaster.Id  
                             orderby d.IdProductType, d.ProductDescription, d.BillNumber  
                             select d;  
            radGridInvoiceDetails.ItemsSource = collection.ToList();  
        }  
 
        GroupDescriptor descriptor = new Telerik.Windows.Data.GroupDescriptor();  
        descriptor.Member = "ProductFamilyDescription";  
        descriptor.DisplayContent = "Famiglia";  
        descriptor.SortDirection = ListSortDirection.Ascending;  
        radGridInvoiceDetails.GroupDescriptors.Add(descriptor);  
 
        descriptor = new Telerik.Windows.Data.GroupDescriptor();  
        var sumFunction = new Telerik.Windows.Data.SumFunction();  
        sumFunction.ResultFormatString = "{0:N2}";  
        sumFunction.SourceField = "ProductQuantity";  
        sumFunction.Caption = "Totale Quantità";  
        descriptor.AggregateFunctions.Add(sumFunction);  
 
        sumFunction = new Telerik.Windows.Data.SumFunction();  
        sumFunction.ResultFormatString = "{0:N2}";  
        sumFunction.SourceField = "TotalBill";  
        sumFunction.Caption = "Totale Imponibile";  
        descriptor.AggregateFunctions.Add(sumFunction);  
 
        sumFunction = new Telerik.Windows.Data.SumFunction();  
        sumFunction.ResultFormatString = "{0:N2}";  
        sumFunction.SourceField = "TotalVAT";  
        sumFunction.Caption = "Totale Con IVA";  
        descriptor.AggregateFunctions.Add(sumFunction);  
 
        descriptor.Member = "ProductDescription";  
        descriptor.DisplayContent = "Prodotto";  
        descriptor.SortDirection = ListSortDirection.Ascending;  
        radGridInvoiceDetails.GroupDescriptors.Add(descriptor);  
    }  
    catch (Exception ex)  
    {  
        throw ex;  
    }  
}  
 

It happens that the first time I bind data in the radgrid view the groups are duplicated.
The first does not contains the sum values, the second yes.

The second time an exception is thrown.
System.ArgumentException was unhandled by user code  
  Message="The value \"[Group: Key=RCK 25.0 S3 F.FULLER NO; ItemCount=1; HasSubgroups=False; ParentGroup=null];\" is not of type \"Raise.FarinaEzio.SIB.Client.Management.DataContext.InvoiceDetail\" and cannot be used in this generic collection.\r\nParameter name: value" 
  Source="mscorlib" 
  ParamName="value" 
  StackTrace:  
       at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)  
       at System.Collections.Generic.List`1.VerifyValueType(Object value)  
       at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item)  
       at Telerik.Windows.Data.QueryableCollectionView.PopulateInternalList(IQueryable view) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 482  
       at Telerik.Windows.Data.QueryableCollectionView.<>c__DisplayClassa.<CreateInternalList>b__6(Object s, DoWorkEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 458  
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)  
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)  
  InnerException:   
 

Hope this details help you to help me...

Bye

Stefan Dobrev
Telerik team
 answered on 25 Mar 2010
1 answer
115 views
When you change the theme in for instance msWord, the whole WindowBackground changes to the choosen theme.
How should this be done with Telerik...
I know you can use:

public Window1()
{
      AppllicationTheme = new VistaTheme();
      InitializeComponent();
 }

But this only effects the RadControls.
How to change the WindowBackground?

Marinus
Dimitrina
Telerik team
 answered on 25 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?