Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

I tried to follow your example in

https://blazor.syncfusion.com/documentation/datagrid/custom-binding/#custom-adaptor-as-component

to create my own version of (remote) data provider.


So, following the example, I created a grid configured like:

<SfGrid @ref="Grid" ID="Grid" TValue="Friend" AllowSorting="true" AllowPaging="true" AllowFiltering="true">
  <SfDataManager Adaptor="Adaptors.CustomAdaptor">

        <CustomGridAdaptorComponent></CustomGridAdaptorComponent>

  </SfDataManager>
...

And created the [customGridAdaptorComponent.razor] implementation. Since it never worked for me, I removed excess code to remain with this last simple example, that still doesn't work:


@inherits DataAdaptor<Friend>

<CascadingValue Value="@this">

  @ChildContent

</CascadingValue>


@code {

    [Parameter]

    [JsonIgnore]

    public RenderFragment ChildContent { get; set; }


    public override object Read(DataManagerRequest dm, string key = null)

    {

        Friend[] friends = new Friend[]

        {

          new Friend{Id = Guid.NewGuid(), Name = "aaa", City = "bbb", Kind = Friend.RelationshipKind.Best },

          new Friend{Id = Guid.NewGuid(), Name = "ccc", City = "ddd", Kind = Friend.RelationshipKind.Best }

        };

        return new DataResult{ Result = friends, Count = 2 };

    }

}


I tried to change the return value to:

- return new DataResult{ Result = friends.ToList(), Count = 2 };

- return new object{ Result = friends, Count = 2 }

- return new object{ result = friends, count = 2 }

But with no difference.


Registering an OnActionFailure event, the error I always get back is (stack trace from Syncfusion.Blazor.Grids.FailureEventArgs args:


' at Syncfusion.Blazor.Grids.SfGrid`1.d__321[[DoNothing.Shared.Friend, DoNothing.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Grids.SfGrid`1.d__317[[DoNothing.Shared.Friend, DoNothing.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()'


I'm probably missing something stupid, but i don't think to read anything more than this, in the example.


Thanks for your support.