SfDatamanager seems to work but no data in datagrid

I have this code:
And when the page is loaded the Get Request is fired but, the data is not shown in the Grid.
Please help me I don't understand why the data does not show in the SfGrid??

    <SfGrid TValue="UnitMappingDtoForViewing" AllowResizing="true" EnableHover="true" AllowPaging="true" AllowSorting="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
        <SfDataManager Url="@UnitMappingUrl" Adaptor="Adaptors.JsonAdaptor"></SfDataManager>
        <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Normal"></GridEditSettings>
        <GridPageSettings PageSize="10"></GridPageSettings>
        <GridColumns>
            <GridColumn Field="Id" HeaderText="ID" IsPrimaryKey="true" IsIdentity="true" AutoFit="true"></GridColumn>
            <GridColumn Field="PLMUnit" HeaderText="PLM/PDM Unit" AutoFit="true"></GridColumn>
            <GridColumn Field="IsahUnit" HeaderText="Isah Unit" AutoFit="true"></GridColumn>
            @*@foreach (var prop in typeof(UnitMappingDtoForViewing).GetProperties())
                {
                    <GridColumn Field="@prop.Name" AutoFit="true"></GridColumn>
                }*@
        </GridColumns>
    </SfGrid>

code behind:
namespace EngineeringAPIWebsite.Pages
{
    public class UnitMappingListBase :ComponentBase
    {
        public class UnitMappingDtoForViewing
        {
            public Int32 Id { get; set; }
            public string PLMUnit { get; set; }
            public string IsahUnit { get; set; }
        }
        public string UnitMappingUrl = "http://localhost:6789/api/EngineeringUnitMapping/";
    }
}

4 Replies

JV John van Nuland July 15, 2020 09:52 AM UTC

I got it to work now with some examples provided in the other posts
Thanks a lot!


RS Renjith Singh Rajendran Syncfusion Team July 15, 2020 12:39 PM UTC

Hi John, 

Greetings from Syncfusion support. 

We are glad to hear that the reported problem has been  resolved. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 



MI Miguel May 28, 2021 06:10 PM UTC

I have exactly the same problem. Which other posts did you refer to make it work?

Thank you


VN Vignesh Natarajan Syncfusion Team May 31, 2021 11:23 AM UTC

Hi Miguel,  

Thanks for contacting Syncfusion support.  

Query: “SfDatamanager seems to work but no data in datagrid” 

From your query we understand that you are facing trouble in binding the data to Grid component using SfDataManager. We need some more details about your issue, so kindly share the following details.  

  1. Share the Grid code example.
  2. Share the details about the SfDataManager along with its adaptor type.
  3. Share the error details by binding the OnActionFailure event to Grid component.
  4. Are you facing any script error in browser console. If yes, share the screenshot of the issue.
  5. Also share the details about your datasource type.

Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.  

Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon