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

Setting of Edit Params for a EditType does not compile

Thread ID:

Created:

Updated:

Platform:

Replies:

148613 Oct 28,2019 02:45 AM UTC Oct 29,2019 10:38 AM UTC Blazor 3
loading
Tags: Grid
Nick Wong
Asked On October 28, 2019 02:45 AM UTC

As per example of https://ej2.syncfusion.com/blazor/documentation/grid/editing/#cell-edit-type-and-its-params

When the Client project is set to .Net Standard 2.0, the code does not compile.

When set to .Net Standard 2.1, the code CAN compile, but the IDE is not happy of it - showing messages:

Anonymous Types: 'a is new { NjsNumericTextBox<int> params }
',' or '}' expected

I am currently on .Net core 3.1 Preview, with Syncfusion's 3.1 components as well.

Resharper has been installed - latest 2019.2.3

VisualStudio currently on 2019 - 16.3.6

Is it related to Visual studio or Resharper or something else?

Vignesh Natarajan [Syncfusion]
Replied On October 28, 2019 07:40 AM UTC

Hi Nick,  
 
Greetings from Syncfusion support.  
 
Query: “When the Client project is set to .Net Standard 2.0, the code does not compile. && When set to .Net Standard 2.1, the code CAN compile, but the IDE is not happy of it - showing messages 
 
As per your suggestion we have prepared a Client Side Blazor application using the code example provided in the documentation. We are not able to reproduce the reported issue at our end. Kindly download the sample which we have prepared using .Net Core 3.1 Preview 1 and Syncfusion latest Nuget package (17.3.0.19-beta) from below. 
 
 
Kindly ensure that you have referred same version of script files and Nuget Package. 
 
    <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.3.19/fabric.css" rel="stylesheet" /> 
    <script src="https://cdn.syncfusion.com/ej2/17.3.19/dist/ej2.min.js"></script> 
 
 
After referring the sample, If you are still facing the issue kindly get back to us with following details.  
 
  1. Share the screenshot of script error with full stack trace.
  2. Share your Syncfusion package version.
  3. If possible try to reproduce the reported issue in provided sample or share the issue reproducible sample.     
 
Regards, 
Vignesh Natarajan. 


Nick Wong
Replied On October 29, 2019 02:36 AM UTC

Hi Nick,  
 
Greetings from Syncfusion support.  
 
Query: “When the Client project is set to .Net Standard 2.0, the code does not compile. && When set to .Net Standard 2.1, the code CAN compile, but the IDE is not happy of it - showing messages 
 
As per your suggestion we have prepared a Client Side Blazor application using the code example provided in the documentation. We are not able to reproduce the reported issue at our end. Kindly download the sample which we have prepared using .Net Core 3.1 Preview 1 and Syncfusion latest Nuget package (17.3.0.19-beta) from below. 
 
 
Kindly ensure that you have referred same version of script files and Nuget Package. 
 
    <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.3.19/fabric.css" rel="stylesheet" /> 
    <script src="https://cdn.syncfusion.com/ej2/17.3.19/dist/ej2.min.js"></script> 
 
 
After referring the sample, If you are still facing the issue kindly get back to us with following details.  
 
  1. Share the screenshot of script error with full stack trace.
  2. Share your Syncfusion package version.
  3. If possible try to reproduce the reported issue in provided sample or share the issue reproducible sample.     
 
Regards, 
Vignesh Natarajan. 


OK, thanks!
I realized it is just resharper showing the message on editor only.
After disabing it, the messages are gone.

Furth
- can you let me know why the params is actually the component itself?
- If i intend to declare inline at GridColumn:
   <GridColumn ....   EditType="EditType.NumericEdit" Edit="@(new { @params = new EjsNumericTextBox<int>() { Decimals = 3, Value = 4 } })"> <GridColumn>
  is there any cleaner declaration that i can skip the EjsNumericTextBox<int> part? (for example something like: @(new { @params = new  { Decimals = 3, Value = 4 } }) - doesnt work as tried)
- Also, when declaring those params in the code block, do you see the indentation broken?

Rahul Narayanasamy [Syncfusion]
Replied On October 29, 2019 10:38 AM UTC

Hi Nick, 
 
Thanks for your update. 
 
Query: can you let me know why the params is actually the component itself? 
 
We have provided Edit params using component class for better suggestions to know available properties. 
 
Query: is there any cleaner declaration that i can skip the EjsNumericTextBox<int> part? (for example something like: @(new { @params = new  { Decimals = 3, Value = 4 } }) - doesnt work as tried) 
 
Yes, you can modify the EjsNumericTextBox properties by skipping EjsNumericTextBox<int> part. But you need to define the properties in lowercase because it will be serialized. Find the below code snippets for your reference. 
 
[code snippets] 
<EjsGrid DataSource="@OrderData" Toolbar=@ToolbarItems> 
    <GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings> 
    <GridColumns> 
        ... 
       <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" EditType="EditType.NumericEdit" Edit="@(new { @params = new  { decimals = 3, value = 4 } })" TextAlign="TextAlign.Center" Width="130"></GridColumn> 
        ... 
   </GridColumns> 
</EjsGrid> 
 
 
Query: when declaring those params in the code block, do you see the indentation broken? 
 
If you want to define edit params in code block, then you can define and escape the @ in the params like in the below code snippets. If you face indent problem after escaping please give us more details on this problem. 
 
 
<EjsGrid DataSource="@OrderData" Toolbar=@ToolbarItems> 
    <GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings> 
    <GridColumns> 
        ... 
       <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" EditType="EditType.NumericEdit" Edit="@FreightEditParams" TextAlign="TextAlign.Center" Width="130"></GridColumn> 
        ... 
   </GridColumns> 
</EjsGrid> 
 
@code{ 
    public string[] ToolbarItems = new string[] { "Add", "Edit", "Delete", "Update", "Cancel" }; 
 
    public object FreightEditParams = new 
    { 
          @@params = new EjsNumericTextBox<int>() { Decimals = 3, Value = 4 } 
    }; 
 
    ... 
 
... 
} 
 
Please get back to us if you need further assistance. 
 
Regards, 
Rahul 
 


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