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

Creating a dynamic EjsGrid, Grid freezes while trying to edit

Thread ID:

Created:

Updated:

Platform:

Replies:

149238 Nov 19,2019 09:01 PM UTC Nov 21,2019 11:52 AM UTC Blazor 3
loading
Tags: Grid
Brian
Asked On November 19, 2019 09:01 PM UTC

I created an algorithm that adds/removes items from an EjsGrid based on items from an EjsTreeView checklist. That part works fine and I accomplished it by using @ref on the EjsGrid, however I want one of the columns to be editable. When I try to edit the column in question, the grid freezes. Perhaps I am referencing something wrong and not passing the user's inputted data correctly. I have attached my Visual Studio project. Checkout.razor is the page I am working on.

My grid looks like (as you will see in the zip file):

<EjsGrid DataSource="FinalItems" @ref="grid">
        <GridEditSettings AllowEditing="true"></GridEditSettings>
        <GridColumns>
            <GridColumn AllowEditing="false" Field=@nameof(CheckoutItem.Name) HeaderText="Name" Width="50"></GridColumn>
            <GridColumn Field=@nameof(CheckoutItem.Quantity) HeaderText="Quantity" Width="35" EditType="EditType.NumericEdit"></GridColumn>
        </GridColumns>
    </EjsGrid>

Whenever I attempt to edit Quantity, it freezes.



Attachment: FrontCounter_e266e54a.zip

Renjith Singh Rajendran [Syncfusion]
Replied On November 20, 2019 11:43 AM UTC

Hi Brian, 

Thanks for contacting Syncfusion support. 

The problem occurred because of not enabling the “IsPrimaryKey” property for a unique value column in Grid. To perform editing in Grid, it is a must to define a unique value column as primary key column. 

We suggest you to ensure to provide “IsPrimaryKey” property for any one of the unique value column in Grid.  

 
        <GridColumns> 
            <GridColumn AllowEditing="false" IsPrimaryKey="true" Field=@nameof(CheckoutItem.Name) HeaderText="Name" Width="50"></GridColumn> 
            <GridColumn Field=@nameof(CheckoutItem.Quantity) HeaderText="Quantity" Width="35" EditType="EditType.NumericEdit"></GridColumn> 
        </GridColumns> 


 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran.  


Brian
Replied On November 20, 2019 09:43 PM UTC

Hi Brian, 

Thanks for contacting Syncfusion support. 

The problem occurred because of not enabling the “IsPrimaryKey” property for a unique value column in Grid. To perform editing in Grid, it is a must to define a unique value column as primary key column. 

We suggest you to ensure to provide “IsPrimaryKey” property for any one of the unique value column in Grid.  

 
        <GridColumns> 
            <GridColumn AllowEditing="false" IsPrimaryKey="true" Field=@nameof(CheckoutItem.Name) HeaderText="Name" Width="50"></GridColumn> 
            <GridColumn Field=@nameof(CheckoutItem.Quantity) HeaderText="Quantity" Width="35" EditType="EditType.NumericEdit"></GridColumn> 
        </GridColumns> 


 
Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran.  


Thank you this solved my issue.

I am now trying to set it where the minimum value of the Quantity column is 1 and I am also trying to remove decimal input. How can I do this?

Renjith Singh Rajendran [Syncfusion]
Replied On November 21, 2019 11:52 AM UTC

Hi Brian, 

We suggest you to use the “Edit params feature” of Grid. In this, set the “Min” and “Format” properties of EjsNumericTextBox to achieve your requirement. Please refer the documentation link below, 
 
Please use the code below, 

 
<div class="column2"> 
    <EjsGrid DataSource="FinalItems" @ref="grid"> 
        <GridEditSettings AllowEditing="true"></GridEditSettings> 
        <GridColumns> 
            <GridColumn AllowEditing="false" IsPrimaryKey="true" Field=@nameof(CheckoutItem.Name) HeaderText="Name" Width="150"></GridColumn> 
            <GridColumn Field=@nameof(CheckoutItem.Quantity) ... EditType="EditType.NumericEdit" Edit="@QuantityEditParams"></GridColumn> 
        </GridColumns> 
    </EjsGrid> 
</div> 
 
 
@code{ 
    public object QuantityEditParams = new 
    { 
       @@params = new EjsNumericTextBox<int>() { Min = 1, Format = "N0" } 
    }; 
    ... 
} 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


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