Home Forums WPF controls Xceed DataGrid for WPF Getting a exception now since upgrading to 2.0

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26172 |

    Since upgrading to 2.0 from 1.3 I am now getting this exception whenever I run my program. (I also built a test app that just had the grid on it as well and am still getting the same exception)

    System.Windows.Markup.XamlParseException occurred
    Message=” Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Error at object ‘System.Windows.ResourceDictionary’.”
    Source=”PresentationFramework”
    LineNumber=0
    LinePosition=0
    NameContext=”frontHost”
    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.ThrowException(String message, Exception innerException)
    at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
    at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
    at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
    at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
    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 iGlimpse2.Window1.InitializeComponent() in c:\expression\projects\iGlimpse2\Window1.xaml:line 1
    at iGlimpse2.Window1..ctor() in C:\expression\projects\iGlimpse2\Window1.xaml.cs:line 75
    InnerException: System.ArgumentException
    Message=”Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey'”
    Source=”mscorlib”
    StackTrace:
    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
    at System.Collections.Hashtable.Add(Object key, Object value)
    at System.Windows.ResourceDictionary.SetKeys(ArrayList keyCollection, List`1 staticResourceValuesList, ParserContext context)
    at System.Windows.ResourceDictionary.SetDeferableContent(Stream bamlStream, Int64 startPosition, Int32 contentSize, ParserContext context, Object rootElement, ArrayList keyCollection, List`1 staticResourceValuesList)
    at System.Windows.Markup.BamlRecordReader.ReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord)
    at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
    InnerException:

    Any ideas?

    Imported from legacy forums. Posted by David (had 6894 views)

    Xceed Support
    Member
    Post count: 5658

    Would it be possible for you to send a repro to support@xceedsoft.com? Also, what view and theme are you attempting to use?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 434 views)

    User (Old forums)
    Member
    Post count: 23064

    There is something else that seems to be happening as well.

    When I try to use the Designer in Visual Studio 2008 (or Blend) it won’t let me drag the DataGridControl onto my wpf form. I get this dialog box that says: “Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Error at object ‘System.Windows.ResourceDictionary’.

    I have done all the steps that the “Creating your first DataGrid Project” html has told me to do. I have no other controls on the form….its totally blank.

    Does this help? Should I still send a project in?

    Imported from legacy forums. Posted by David (had 471 views)

    Xceed Support
    Member
    Post count: 5658

    Yes. A project will help us pinpoint the issue.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 452 views)

    User (Old forums)
    Member
    Post count: 23064

    I faced the same problem after upgrading to 2.0

    Running the Live Explorer or samples like SolidFoundation will return the error below:

    System.Windows.Markup.XamlParseException was unhandled
    Message=” Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Error at object ‘System.Windows.ResourceDictionary’.”
    Source=”PresentationFramework”
    LineNumber=0
    LinePosition=0
    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.ThrowException(String message, Exception innerException)
    at System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)
    at System.Windows.Markup.BamlRecordReader.GetElementAndFlags(BamlElementStartRecord bamlElementStartRecord, Object& element, ReaderFlags& flags, Type& delayCreatedType, Int16& delayCreatedTypeId)
    at System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
    at System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord)
    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.Navigation.NavigationService.GetObjectFromResponse(WebRequest request, WebResponse response, Uri destinationUri, Object navState)
    at System.Windows.Navigation.NavigationService.DoNavigate(Uri source, NavigationMode f, Object navState)
    at System.Windows.Navigation.NavigateQueueItem.Dispatch(Object obj)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
    at System.Windows.Threading.DispatcherOperation.InvokeImpl()
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
    at System.Threading.ExecutionContext.runTryCode(Object userData)
    at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Threading.DispatcherOperation.Invoke()
    at System.Windows.Threading.Dispatcher.ProcessQueue()
    at System.Windows.Threading.Dispatcher.WndProcHook(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, Boolean isSingleParameter)
    at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
    at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    at System.Windows.Threading.Dispatcher.Run()
    at System.Windows.Application.RunInternal(Window window)
    at System.Windows.Application.Run(Window window)
    at System.Windows.Application.Run()
    at Xceed.Wpf.DataGrid.Samples.SolidFoundation.App.Main() in C:\Xceed Samples\Xceed DataGrid for WPF v2.0\CSharp\SolidFoundation\obj\Debug\App.g.cs:line 0
    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException: System.ArgumentException
    Message=”Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey'”
    Source=”mscorlib”
    StackTrace:
    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
    at System.Collections.Hashtable.Add(Object key, Object value)
    at System.Windows.ResourceDictionary.SetKeys(ArrayList keyCollection, List`1 staticResourceValuesList, ParserContext context)
    at System.Windows.ResourceDictionary.SetDeferableContent(Stream bamlStream, Int64 startPosition, Int32 contentSize, ParserContext context, Object rootElement, ArrayList keyCollection, List`1 staticResourceValuesList)
    at System.Windows.Markup.BamlRecordReader.ReadDeferableContentStart(BamlDeferableContentStartRecord bamlRecord)
    at System.Windows.Markup.BamlRecordReader.ReadRecord(B

    Imported from legacy forums. Posted by Thien Pow (had 694 views)

    User (Old forums)
    Member
    Post count: 23064

    I also get that error when running the demo that is online.

    I assume you get that error when you run a program you build?

    Imported from legacy forums. Posted by David (had 750 views)

    Xceed Support
    Member
    Post count: 5658

    Would it be possible to get repro steps to reproduce this issue please? It would be a great help in order to identify and correct the issue.

    Which Theme, View, what actions you performed?

    Imported from legacy forums. Posted by Chris [Xceed] (had 880 views)

    User (Old forums)
    Member
    Post count: 23064

    I did send a barebones project in last night to your support email address with one of the problems I am experiencing. (In the designer I can’t drag a datagrid onto the wpf form)

    I could send another project in that I manually enter the datagrid in the XAML code and then it will show the above exception.

    I get the feeling it is some setup issue when version 2.0 was installed.
    I will try installing version 2.0 onto my home machine later tonight.

    Imported from legacy forums. Posted by David (had 521 views)

    User (Old forums)
    Member
    Post count: 23064

    Running the Live Explorer or samples like SolidFoundation will return the error below:

    System.Windows.Markup.XamlParseException was unhandled
    Message=” Item has already been added. Key in dictionary: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Key being added: ‘Xceed.Wpf.DataGrid.Markup.ThemeKey’ Error at object ‘System.Windows.ResourceDictionary’.”
    Source=”PresentationFramework”

    Imported from legacy forums. Posted by Thien Pow (had 589 views)

    Xceed Support
    Member
    Post count: 5658

    It seems the developers found the problem. There was a bug for users using the Olive XP system theme.

    This will be fixed in the next service release (scheduled for next week). Meanwhile, you just need to change your OS System theme.

    Imported from legacy forums. Posted by CharlesB (had 463 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks.

    It works by changing the theme.

    Imported from legacy forums. Posted by Thien Pow (had 6957 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m using the lasted version of the wpf grid and still have the issue… what is the “next service release” are you talking about? where can I find it?

     thanks.

    Imported from legacy forums. Posted by alpha (had 787 views)

    User (Old forums)
    Member
    Post count: 23064

    This “bug” still seems to be lurking in the tutorial for introducing a custom theme.  Namely the Elemental.Pink theme sample code from the help system.  The line is from CardflowView3d.Elemental.Pink.xaml:

        <Style x:Key=”{xcdg:ThemeKey TargetViewType=xcdg:CardflowView3D, ThemeType=local:ElementalPinkTheme, TargetElementType=xcdg:ScrollTip}”
             TargetType=”xcdg:ScrollTip”
             BasedOn=”{StaticResource cardViewElementalPinkCardflowScrollTipStyle}” />

    Any of the style keys seem to exhibit the same behavior… I’m going to go look through ThemeKey right now, since it seems the method call to that is not generating a unique id based on those parameters.

     

    I could be wrong though… I feel like I’m doing the tutorial as written.  But it looks like the resource dictionary for CardflowView3d.Elemental.Pink.xaml is getting loaded twice somehow.

    Imported from legacy forums. Posted by Michael (had 443 views)

    User (Old forums)
    Member
    Post count: 23064

    Kewl… Fixed it…

    Took the main DataGrid3d.Elemental.Pink.xaml file from the Elemental.Pink and:

    1) remove all occurrences of x:Key=”xcdg”

    2) Once this is done, there is a missing resource key called “gridlines”.  Found the control template with the x:Key=“ffffff” and made that x:Key=”gridlines”

    These issues are in your online documentation and should be changed.

    Imported from legacy forums. Posted by Michael (had 916 views)

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.