We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Use the list instead of the URL in hosted core blazor

Thread ID:

Created:

Updated:

Platform:

Replies:

146264 Jul 29,2019 08:53 AM UTC Oct 11,2019 09:54 AM UTC Blazor 7
loading
Tags: Grid
ebi torabi
Asked On July 29, 2019 08:53 AM UTC

Before

<GridColumn Field=@nameof(Allergies.AllergyCategoryId) HeaderText="AllergyCategoryId" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true  })" ForeignKeyField="Id" ForeignKeyValue="Name"
                        DataSource="@(new Syncfusion.EJ2.Blazor.DataManager(){ Url = "api/AllergyCategories/GetNameId", Adaptor= Syncfusion.EJ2.Blazor.Adaptors.WebApiAdaptor })"></GridColumn>
 
after-----------------------------------------------------------------------------------------------------------------

<GridColumn Field=@nameof(Allergies.AllergyCategoryId) HeaderText="AllergyCategoryId" TextAlign="@TextAlign.Center" ValidationRules="@(new { required= true  })" ForeignKeyField="Id" ForeignKeyValue="Name"
                        DataSource="AllergyCategoriesList"></GridColumn>
code
{
 protected override async Task OnInitAsync()
    {

        
        AllergyCategoriesList = await http.GetJsonAsync<Allergies[]>("api/AllergyCategories");
}

Vignesh Natarajan [Syncfusion]
Replied On July 30, 2019 04:13 PM UTC

Hi Edi Torabi,  

Thanks for your suggestion. 
 
Query: “Use the list instead of the url in blazor hosted sample” 

Case1: “While using DataManager (WebAPI Adaptor)” 
 
If we bind the column dataSource using WebAPI adaptor, post will be sent to server for each request or during a edit action. So new dataSource will be fetched from the server for each time.  
 
Case2: “While binding a data in form of list” 
 
We can bind the column dataSource using your suggested method (i.e) GetJSONAsync() of Blazor. While binding dataSource using this method, data will bound in form of list of objects. (Local data). So post will not be sent for each request. Initially requested list be bounded to column dataSource.    

If we need to fetch new data from server for each request, we suggest you to use WebAPIAdaptor, or if you do not want to fetch the data from server for each action, you can bind the dataSource using getJsonAsync() to fetch data from WebAPI service. 

Above explained methods can be used to bind dataSource to grid column 

Please get back to us if you have any queries.   

Regards, 
Vignesh Natarajan. 


ebi torabi
Replied On July 30, 2019 08:51 PM UTC

 but data form a list does not bound
DataSource="AllergyCategoriesList"


Vignesh Natarajan [Syncfusion]
Replied On July 31, 2019 03:44 PM UTC

Hi Ebi Torabi, 

Sorry for the inconvenience caused.  

We have validated the reported query by preparing a sample and we are able to reproduce it our end too. We are validating your query further and update you the details on August 1st 2019.    

Regards, 
Vignesh Natarajan. 


ebi torabi
Replied On August 2, 2019 08:24 PM UTC

       
       
       
           
           

           



          <GridColumn Field=@nameof(Allergies.AllergyCategoryId) HeaderText="AllergyCategoryId"  ForeignKeyField="AllergyCategoryId" ForeignKeyValue="AllergyCategoryName" DataSource="@(new Syncfusion
        .EJ2.Blazor.DataManager(){ Url = "api/AllergyCategories", Adaptor= Adaptors.WebApiAdaptor })">

           

       



Both of the above do not work in version 17.2.0.40

If possible use an example template like the following code(ForeignKey)( hosted core blazor)

<EditTemplate>
                <EjsDropDownList Value="@((context as Order).CustomerID)" DataSource="@Orders">
                    <DropDownListFieldSettings Value="CustomerID"></AutoCompleteFieldSettings>
                </EjsDropDownList
></EditTemplate>


Rahul Narayanasamy [Syncfusion]
Replied On August 7, 2019 06:26 AM UTC

Hi Ebi Torabi, 
  
Thanks for your patience. 
  
Query: Use the list instead of the url in blazor hosted sample 
  
We have checked reported problem and we have logged “Column's dataSource is not updated when using await GetJsonAsync method” as a bug. Thank you for taking the time to report this issue and helping us improve our product. The fix for this issue will be included in our upcoming NuGet release which will be expected to be rolled out on August 19, 2019. 
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
  
  
Query: foreign key datasource provided in column level is not working 
  
We have checked reported problem and we have logged “Column's dataSource provided as WebAPI Adpator is converted to BlazorAdaptor during initial rendering” as a bug. Thank you for taking the time to report this issue and helping us improve our product. The fix for this issue will be included in our upcoming NuGet release which will be expected to be rolled out on August 19, 2019. Until then we appreciate your patience. 
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
  
  
Query: If possible use an example template like the following code(ForeignKey)( hosted core blazor) 
  
Based on your request, we have tried to prepare the sample. Due to above reported problem, currently it is not possible to achieve this requirement. Once the above reported problems are fixed, we will get back to you with the sample. 
  
Until then we appreciate your patience. 
  
Regards, 
Rahul 


ebi torabi
Replied On August 7, 2019 12:41 PM UTC

Hi Rahul . Thank you very much for your reply.

Vignesh Natarajan [Syncfusion]
Replied On October 11, 2019 09:54 AM UTC

Hi Ebi Torabi,  
 
We are glad to inform that our latest Nuget package (17.3.0.17-beta) has been successfully rolled out. In this release we have included the fix for the issue “Column's dataSource is not updated when using await GetJsonAsync method”. Please find the latest Nuget package from below   
 
 
 
Also ensure that you have referred the latest version script and css as below  
 
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.3.17/fabric.css" rel="stylesheet" /> 
    <script src="https://cdn.syncfusion.com/ej2/17.3.17/dist/ej2.min.js"></script>   
 
For your convenience we have prepared a sample to bind the dataSource to Grid and Grid Column using GetJsonAsync method.  
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon