Home Forums WPF controls Xceed DataGrid for WPF Crash on column click

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

    hallo,
    this is my DataGridCollectionViewSource defined inside grid resources

    <xcdg:DataGridCollectionViewSource x:Key=”cvs_personlist”
    ItemType=”{x:Type local:Person}”>
    <xcdg:DataGridCollectionViewSource.Source x:Uid=”view”>
    <Binding Source=”{x:Static Application.Current}” Path=”MainWindow.PersonList” />
    </xcdg:DataGridCollectionViewSource.Source>
    </xcdg:DataGridCollectionViewSource>

    it bind as source the “MainWindow.PersonList” object (a BindingList object)

    I fille det dataGrid using this xaml:

    <xcdg:DataGridControl x:Name=”PersonGrid”
    AutoCreateColumns=”False”
    ItemsSource=”{Binding Source={StaticResource cvs_personlist}, Path=View}”>
    <xcdg:DataGridControl.Columns>
    <xcdg:Column Title=”Person” FieldName=”.” />
    </xcdg:DataGridControl.Columns>
    </xcdg:DataGridControl>

    It work fine, but if click on column name it crash with this message:

    System.InvalidOperationException was unhandled
    Message=”The property name ‘.’ does not exist.”
    Source=”Xceed.Wpf.DataGrid”
    StackTrace:
    at Xceed.Wpf.DataGrid.DataGridCollectionView.PrepareSort(SortDescriptionInfo[]& sortDescriptionInfos)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.ProcessDeferredOperations(List`1 deferredOperations, Boolean processAll)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.ProcessDeferredOperations(Object processAll)
    at Xceed.Wpf.DataGrid.DataGridCollectionView.DeferRefreshHelper.Dispose()
    at System.Windows.Controls.ItemCollection.EndDefer()
    at System.Windows.Controls.ItemCollection.DeferHelper.Dispose()
    at Xceed.Wpf.DataGrid.DataGridControl.ApplyColumnSort(Column column, SortDirection sortDirection)
    at Xceed.Wpf.DataGrid.DataGridControl.ToggleColumnSort(Column column, ModifierKeys modifiers)
    at Xceed.Wpf.DataGrid.ColumnManagerCell.OnMouseLeftButtonUp(MouseButtonEventArgs e)
    at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
    at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.ReRaiseEventAs(RoutedEventArgs args, RoutedEvent newEvent)
    at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
    at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args)
    at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.InputFilterMessage(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 MyDataGrid_Test.App.Main() in C:\Documents and Settings\dicomed\Desktop\Blend2_FirstProject\XceedGrid_Sample\MyDataGrid_Test\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:

    Imported from legacy forums. Posted by Matteo (had 849 views)

    User (Old forums)
    Member
    Post count: 23064

    In the ColumnName you have to specify the exact name of the property that you bound to.
    It’s look like in your source no property with such name as “.”.
    Ex:
    <xcdg:Column FieldName=”Person” Title=” Person ” VisiblePosition=”0″
    Width=”100″ DisplayMemberBinding=”{Binding Path=Person}”>
    FieldName and Binding Path pointing to the same property off the collection. Title is how you want to display header for this column.
    Also, if you customizing appearence in the grid, you might need to wrap your grid in AdornerDecorator.

    Imported from legacy forums. Posted by Lena (had 434 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi Lena,
    I understand that there’s no properties named “.” inside the Source, but the goal for my app is to put each element inside the BindingList object “MainWindow.PersonList” into the grid, i mean: if “MainWindow.PersonList” is composed of 10 Person elements (Person is a custom class that present 2 properties: FirstName and LastName) I need 10 cells under one colum (than i’ll apply a DataTemplate for the class Person, but this is another story….).

    I don’t want to bind the properties of each class Person inside PersonList, i need to bind the objects Person inside the PersonList.

    I hope to explain the problem in a better way….

    thanks a lot

    Matteo

    Imported from legacy forums. Posted by Matteo (had 361 views)

    User (Old forums)
    Member
    Post count: 23064

    The problem is rooted inside DataGridGroupDescription as I mentioned in http://forums.xceed.com/forums/ShowPost.aspx?PostID=9587. DataGroupGroupDescription add validation code that can validate against the properties at the object level only. It doesn’t support the whole PropertyPath scheme. Hopefully they will remove this validation in the next release.

    Imported from legacy forums. Posted by nat (had 268 views)

    Xceed Support
    Member
    Post count: 5658

    A fix for this issue is available through our <a href=”http://download3.xceedsoft.com/Packages/3.2.7570.10530/XceedComponents.exe”>latest package</a>.

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

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