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. Image for the cookie policy date

Sync-fusion Blazor dynamic query not working

1 Reply

VN Vignesh Natarajan Syncfusion Team January 13, 2020 05:39 AM UTC

Hi Karan,  
 
Greetings from Syncfusion support.  
 
Query: ” So any one have any idea what i did wrong in this query ? 
 
From our 2019 Volume 4 release (17.4.0.39) only we have changed the type of Query property to Query class. Before that release, type of Query property will be string. Kindly refer the below release notes about the changes we have done in our Grid for your reference 
 
 
So kindly upgrade to latest version (17.4.0.42  - because we have fixed the many breaking issue after that main release) to resolve the reported query. Also ensure to import the Syncfusion Blazor Data instance in your sample project.  
 
@using Syncfusion.EJ2.Blazor 
@using Syncfusion.EJ2.Blazor.Buttons 
@using Syncfusion.EJ2.Blazor.Data 
@using Syncfusion.EJ2.Blazor.Grids 
 
 
If you want to use the same approach in 17.3.0.21-beta version, then kindly specify the query property value in form of string (like below).  
 
<EjsGrid ModelType="Model" DataSource="@Employees" Height="315px"> 
    <GridTemplates> 
        <DetailTemplate> 
            @{ 
                var employee = (context as EmployeeData);              
                <EjsGrid DataSource="@Orders" Query="@QueryData(employee)"> 
. . . . . .  
                </EjsGrid> 
            } 
        </DetailTemplate> 
    </GridTemplates> 
. . . . . . .. . .  
</EjsGrid> 
 
@code{ 
    public int? Val { get; set; } 
    public EmployeeData Model = new EmployeeData(); 
    public string QueryData(EmployeeData employee) 
    { 
        return $"new ej.data.Query().where('EmployeeID', 'equal', {employee.EmployeeID})"; 
    }   
. . . . . . . ..  
 
    public class EmployeeData 
    { 
        public int? EmployeeID { get; set; } 
        . . . . . . . . .  
    } 
} 
 
Please get back to us if you have further queries.  
 
Regards, 
Vignesh Natarajan. 


Loader.
Live Chat Icon For mobile
Up arrow icon