You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Avalonia.Collections.AvaloniaList`1.get_Item(Int32 index)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
at Avalonia.Controls.Grid.MeasureOverride(Size constraint)
at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize)
at Avalonia.Layout.Layoutable.Measure(Size availableSize)
at Avalonia.Layout.LayoutManager.Measure(ILayoutable control)
at Avalonia.Layout.LayoutManager.ExecuteMeasurePass()
at Avalonia.Layout.LayoutManager.InnerLayoutPass()
at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
at Avalonia.Threading.JobRunner.Job.Avalonia.Threading.JobRunner.IJob.Run()
at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority)
at Avalonia.Win32.Win32Platform.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
The text was updated successfully, but these errors were encountered:
From what I can tell this only happens if you change this after startup, as the example with the year hidden in the control catalog runs perfectly fine. It also applies to removing the last column of the grid (
The textblock columns are arranged based on the Day/Month/Year Visible properties & user date settings, but the spacers are hard coded to show a grid column 1 & 3 Grid.SetColumn(_spacer1, 1); Grid.SetColumn(_spacer2, 3);
In this case, it then fails on line 1012 in Grid.cs, because PrivateCells[i].ColumnIndex is 3, which exceeds the number of columns in the Grid (3) DefinitionsU[PrivateCells[i].ColumnIndex].UpdateMinSize(Math.Min(children[i].DesiredSize.Width, DefinitionsU[PrivateCells[i].ColumnIndex].UserMaxSize));
As a workaround, setting the spacer columns based on whether they should show does fix the issue: Grid.SetColumn(_spacer1, columnIndex > 1 ? 1 : 0); Grid.SetColumn(_spacer2, columnIndex > 2 ? 3 : 0);
but I'm not too familiar with the Grid code to know if this is correct behavior. I also don't know why this only fails if changing this during runtime
Update:
Can confirm this is not specific to DatePicker, but happens to any Grid where you reduce the number of columns, but leave controls with a Column index greater than the number of columns in the Grid.
Can confirm this is not specific to DatePicker, but happens to any Grid where you reduce the number of columns, but leave controls with a Column index greater than the number of columns in the Grid.
Yep. As I said I saw it in my apps even when there was no such control as DatePicker.
I saw the exception before in my app but wasn't able to provide MCVE. And now finally I got it when I was working on a sample for DatePicker.
Steps to reproduce:
StackTrace
The text was updated successfully, but these errors were encountered: