Home Forums WPF controls Xceed DataGrid for WPF Binding Issue with 1.3

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

    I’m using WPF DataGrid version 1.3.7570 with VS2008 RTM. I’m binding a DataGridControl to this data source:

    <xcdg:DataGridCollectionViewSource x:Key=”PacketsDGSource” />

    The Source of PacketsDGSource is a BindingList created this way:

    if (this.Packets != null)
    {
    (this.FindResource(“PacketsDGSource”) as Xceed.Wpf.DataGrid.DataGridCollectionViewSource).Source = this.Packets.GetNewBindingList();
    }

    Packets is an EntitySet<FundPacket>. It was created by LINQ to SQL.

    When I run the program, I get the following error after the cs DataGridCollectionViewSource is bound:

    System.NullReferenceException was unhandled
    Message=”Object reference not set to an instance of an object.”
    Source=”Xceed.Wpf.DataGrid”
    StackTrace:
    at Xceed.Wpf.DataGrid.DataGridCollectionViewGroup.GetRawItemAtGlobalSortedIndex(Int32 index)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.SaveCurrentBeforeReset(RawItem& oldCurrentRawItem, Int32& oldCurrentPosition)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.ForceRefresh(Boolean sendResetNotification, Boolean initialLoad)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.DeferredOperationManager.Process(Boolean processAll)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.DeferredOperationManager.Dispatched_Process(Object e)
    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 MPG.SchoolMate.App.Main() in D:\VS\MyCompany\obj\Debug\App.g.cs:line 0
    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
    at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
    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:

    I can’t find any place that I’m specifying a NULL reference. The error can’t be caught or found in the debugger. Help!

    Imported from legacy forums. Posted by Brian (had 2569 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    Unfortunately, I was unable to reproduce the issue.

    I used Link to SQL to create a BindingList to the Employees data table.

    Would it be possible for you to send, to my attention, a small sample application reproducing it to support@xceedsoft.com ?

    Thanks

    ie:

    <code>
    NorthwindDataContext northwindDataContext = new NorthwindDataContext();

    IBindingList employees = northwindDataContext.Employees.GetNewBindingList();

    DataGridCollectionViewSource dgcvs = this.FindResource( “cvsEmployees” ) as Xceed.Wpf.DataGrid.DataGridCollectionViewSource;

    dgcvs.Source = employees;
    </code>

    Imported from legacy forums. Posted by PL (had 427 views)

    User (Old forums)
    Member
    Post count: 23064

    I corresponded with Jenny via our Vanguard subscription. She verified there is a bug in 1.3 that produced this error.

    Imported from legacy forums. Posted by Brian (had 3561 views)

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