Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Specified argument was out of the range of valid values. Arg_ParamName_Name' #117

Closed
INTERNALINTERFERENCE opened this issue Jun 27, 2022 · 0 comments

Comments

@INTERNALINTERFERENCE
Copy link

INTERNALINTERFERENCE commented Jun 27, 2022

Help me, please
I have three observable collections that I want to add to the tables. I do following:

public FlatTreeDataGridSource<BaseAccessPoint> AccessPointSource { get; }
public FlatTreeDataGridSource<BaseController> ControllerSource { get; }
public FlatTreeDataGridSource<BasePort> PortSource { get; }
public MainWindowViewModel()
{
        AccessPointSource = new FlatTreeDataGridSource<BaseAccessPoint>( BaseAccessPoint )
        {
            Columns =
            {
                new TextColumn<BaseAccessPoint, string?>( "Timestamp", x => x.LocalTime, GridLength.Star ),
                new TextColumn<BaseAccessPoint, string?>( "Event/Command", x => x.EventName, GridLength.Star )
            },
            Items = BaseAccessPoint
        };

         ... etc
}

My view:

<TreeDataGrid Source="{Binding PortSource}" Grid.Column="0" Grid.Row="1"/>
<TreeDataGrid Source="{Binding ControllerSource }" Grid.Column="1" Grid.Row="1"/>
<TreeDataGrid Source="{Binding AccessPointSource }" Grid.Column="2" Grid.Row="1"/>

I think I'm doing everything right, but unfortunately I get an error:
'Specified argument was out of the range of valid values. Arg_ParamName_Name'

StackTrace:

at Avalonia.Controls.Primitives.TreeDataGridCellsPresenter.UpdateRowIndex(Int32 index) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridCellsPresenter.cs:line 67
 at Avalonia.Controls.Primitives.TreeDataGridRow.UpdateIndex(Int32 index) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridRow.cs:line 86
 at Avalonia.Controls.Primitives.TreeDataGridRowsPresenter.UpdateElementIndex(IControl element, Int32 index) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridRowsPresenter.cs:line 82
 at Avalonia.Controls.Primitives.RealizedElementList.ItemsInserted(Int32 modelIndex, Int32 count, Action`2 updateElementIndex) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/RealizedElementList.cs:line 124
 at Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridPresenterBase.cs:line 584
 at Avalonia.Controls.Models.TreeDataGrid.AnonymousSortableRows`1.OnItemsCollectionChangedUnsorted(NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/AnonymousSortableRows.cs:line 167
 at Avalonia.Controls.Models.TreeDataGrid.AnonymousSortableRows`1.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/AnonymousSortableRows.cs:line 135
 at Avalonia.Controls.TreeDataGridItemsSourceView.OnItemsSourceChanged(NotifyCollectionChangedEventArgs args) in /_/src/Avalonia.Controls.TreeDataGrid/TreeDataGridItemsSourceView.cs:line 216
 at Avalonia.Controls.TreeDataGridItemsSourceView.Avalonia.Controls.Utils.ICollectionChangedListener.Changed(INotifyCollectionChanged sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/TreeDataGridItemsSourceView.cs:line 191
 at Avalonia.Controls.Utils.CollectionChangedEventManager.<Avalonia.Utilities.IWeakSubscriber<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.OnEvent>g__Notify|7_0(INotifyCollectionChanged incc, NotifyCollectionChangedEventArgs args, List`1 listeners) in /_/src/Avalonia.Controls.TreeDataGrid/Utils/CollectionChangedEventManager.cs:line 96
 at Avalonia.Controls.Utils.CollectionChangedEventManager.<>c__DisplayClass7_0.<Avalonia.Utilities.IWeakSubscriber<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.OnEvent>b__1() in /_/src/Avalonia.Controls.TreeDataGrid/Utils/CollectionChangedEventManager.cs:line 124
 at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
 at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 266
 at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
 at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
 at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 66
 at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 121
 at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant