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
Using info from Data_annotations I have tried to make Foo panel work but after click on menu 'Foo sample' we get an exception:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
that is thrown from line: var client = new GridClient<Foo>(q => fooService.GetFooGridRows(q), query, false, "fooGrid", null, locale);
It seems to come from GridClient Constructor since all args are correct, fooService is loaded as well.
This is full stack:
This exception was originally thrown at this call stack:
GridBlazor.CGrid<T>.ApplyGridSettings()
GridBlazor.CGrid<T>.CGrid(System.Net.Http.HttpClient, string, System.Func<GridShared.Utility.QueryDictionary<Microsoft.Extensions.Primitives.StringValues>, GridShared.Utility.ItemsDTO<T>>, System.Func<GridShared.Utility.QueryDictionary<Microsoft.Extensions.Primitives.StringValues>, System.Threading.Tasks.Task<GridShared.Utility.ItemsDTO<T>>>, GridShared.Utility.IQueryDictionary<Microsoft.Extensions.Primitives.StringValues>, bool, System.Action<GridShared.IGridColumnCollection<T>>, System.Globalization.CultureInfo, GridShared.Columns.IColumnBuilder<T>)
GridBlazor.CGrid<T>.CGrid(System.Func<GridShared.Utility.QueryDictionary<Microsoft.Extensions.Primitives.StringValues>, GridShared.Utility.ItemsDTO<T>>, GridShared.Utility.IQueryDictionary<Microsoft.Extensions.Primitives.StringValues>, bool, System.Action<GridShared.IGridColumnCollection<T>>, System.Globalization.CultureInfo, GridShared.Columns.IColumnBuilder<T>)
GridBlazor.GridClient<T>.GridClient(System.Func<GridShared.Utility.QueryDictionary<Microsoft.Extensions.Primitives.StringValues>, GridShared.Utility.ItemsDTO<T>>, GridShared.Utility.QueryDictionary<Microsoft.Extensions.Primitives.StringValues>, bool, string, System.Action<GridShared.IGridColumnCollection<T>>, System.Globalization.CultureInfo, GridShared.Columns.IColumnBuilder<T>)
BlazorGrid.Pages.FooSample.OnParametersSetAsync() in FooSample.razor
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
The text was updated successfully, but these errors were encountered:
borisdj
changed the title
DataAnnotation Null exception and Doc Fix
DataAnnotation Null exception
Jun 22, 2021
I've loaded the Source and have managed to find the issue, null was thrown in CGrid.cs on line: Pager.PageSize = opt.PageSize;
This happend because of attribute [GridTable(PagingEnabled = true, PageSize = 20)]
And it seems that in CGrid constructor line Pager = new GridPager(query); is called after call to ApplyGridSettings();
So the fix is simple to move it before.
heinleit
added a commit
to heinleit/Grid.Blazor
that referenced
this issue
Apr 2, 2023
Using info from Data_annotations I have tried to make Foo panel work but after click on menu 'Foo sample' we get an exception:
that is thrown from line:
var client = new GridClient<Foo>(q => fooService.GetFooGridRows(q), query, false, "fooGrid", null, locale);
It seems to come from GridClient Constructor since all args are correct, fooService is loaded as well.
This is full stack:
The text was updated successfully, but these errors were encountered: