Telerik Forums
UI for WPF Forum
5 answers
219 views
I am investigating whether I can use the selectedItem property from the Carousel and use it with the DrapAndDropManager in order to drag the item to a listbox? Similar to the examples, but with the Carousel.

I tried using the example and applying it to the Carousel control, but I keep getting the error "Cannot convert type 'System.Windows.Controls.ItemsControl' to 'Telerik.Windows.Controls.RadCarousel' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion". when I set up the drag event handler.

Please advise on how I should handle this. I've attached a copy of my code.
    private void OnNurseDragQuery(object sender, DragDropQueryEventArgs e)  
        {  
            CarouselItem nurseItem = e.Options.Source as CarouselItem;  
 
            RadCarousel carousel = CarouselItemsControl.ItemsControlFromItemContainer(nurseItem) as RadCarousel;  
 
            if (e.Options.Status == DragStatus.DragQuery && nurseItem != null)  
            {  
                e.Options.Payload = carousel.SelectedItem;  
                ContentControl cue = new ContentControl();  
                cue.ContentTemplate = this.Resources["ApplicationDragTemplate"as DataTemplate;  
                cue.Content = carousel.SelectedItem;  
                e.Options.DragCue = cue;  
                e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();  
            }  
 
            e.QueryResult = true;             
              
              
       } 


Well, since I've made this post, I've figured out to use the carouselpanel inside a listview which is working just fine, I just now need to get the listBox that I'm dragging to, to accept the drop. the code runs, but I never get the Drag.Status.DragComplete action to work.
Milan
Telerik team
 answered on 29 Mar 2010
12 answers
353 views
Hi,

I have a collection of DateTime and i'd like a RadCalendar with each DateTime from my collection highlited (or underlined or so...).
I have tried to follow the technics described at this url (http://www.telerik.com/help/wpf/radcalendar-selectors.html) with the DayTemplateSelector propertie.

The problem is when i'm trying this code (copy paste from the documention above) :

<telerik:RadCalendar x:Name="calendar" 
                    DayTemplate="{x:Null}" 
                    HorizontalAlignment="Center" 
                    SelectionMode="Extended" 
                    VerticalAlignment="Center"
   <telerik:RadCalendar.DayTemplateSelector> 
       <!--Custom Template selector, sill actually choose just one template--> 
       <my:CustomTemplateSelector> 
           <my:CustomTemplateSelector.DefaultTemplate> 
               <!--A custom template--> 
               <DataTemplate x:Key="defaultTemplate"
                   <TextBlock Text="{Binding Text}" /> 
               </DataTemplate> 
           </my:CustomTemplateSelector.DefaultTemplate> 
       </my:CustomTemplateSelector> 
   </telerik:RadCalendar.DayTemplateSelector> 
</telerik:RadCalendar> 

I have a compilation error saying :

The Key attribute can only be used on a tag contained in a Dictionary (such as a ResourceDictionary). (at line <DataTemplate x:Key="defaultTemplate").

When i delete the Key attribute, my software runs but each day in the RadCalendar are a DayButton.ToString() representation (i.e. Telerik.Windows.Controls.Calendar.CalendarButtonContent") and not the Day number.

Is the example in the documentation wrong ? Or i have commited a mistake.

Many Thanks in advance.
Michael
Top achievements
Rank 1
 answered on 29 Mar 2010
7 answers
340 views
Hi,

Is there a way to select and focus first row in grid at design time. I am using MVVM pattern. Since i cant get access to the grid from ViewModel and also dont want to write any code in codebehind, is it possible to do this at design time in View.
When i give SelectedIndex="0", it selects the fist row, but the focus is not there.

Any help is much appreciated.

Thanks

Sujith
VS
Top achievements
Rank 1
 answered on 29 Mar 2010
1 answer
85 views
Hi,
I am trying to create a wpf web application, and i want to use the carousel control. I have dragged the item on to the page, and visual studio creates the control and everything looks fine and there appears to be no problems. The telerik.windows.controls and navigation references are referenced in the project.

I go to the xaml.cs  to go and bind some data to the control and type in the name of the control, but it can't not be found. If i drag other controls such as a textbox it is found and can be referenced. This driving me mad as I can't seem to be able to get hold of this control. I have tried this on two machines and in different projects and still no luck.

Any help would be great.


Thanks

Simon
Milan
Telerik team
 answered on 29 Mar 2010
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
740 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
129 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
75 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
78 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
351 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?