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

Grid Cell Edit Template does not work

Thread ID:

Created:

Updated:

Platform:

Replies:

148740 Nov 1,2019 10:23 AM UTC Nov 4,2019 05:46 AM UTC Blazor 2
loading
Tags: Grid
vijaymohan
Asked On November 1, 2019 10:23 AM UTC

Dear Sir,

 <EjsGrid  DataSource="@requestProducts" @ref="@RequestProductGrid" ModelType="@ReqModel" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })">
            <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true"></GridEditSettings>
            <GridColumns>
                <GridColumn  Field=@nameof(RequestProduct.ProductId) HeaderText="Product Name" ForeignKeyValue="Name" DataSource="@products" Width="150">
                    <EditTemplate>
                        @{
                            <EjsComboBox ID="Id" Value="@((context as RequestProduct).ProductId)" TValue="int?" DataSource="@products">
                                <ComboBoxFieldSettings Text="Name" Value="Id"></ComboBoxFieldSettings>
                            </EjsComboBox>
                        }
                    </EditTemplate>
                </GridColumn>

                <GridColumn Field=@nameof(RequestProduct.Quantity) HeaderText="Quantity" EditType="EditType.NumericEdit" TextAlign="TextAlign.Right" Width="140"></GridColumn>
                <GridColumn Field=@nameof(RequestProduct.Priority) HeaderText="Priority" EditType="EditType.DropDownEdit" TextAlign="TextAlign.Right" Width="160"></GridColumn>
                <GridColumn Field=@nameof(RequestProduct.Note) HeaderText="Note" EditType="EditType.DefaultEdit" Width="150"></GridColumn>
            </GridColumns>

Please find the attached Video. 

Regards
Vijay

Attachment: Inventory__Edited_8c1022ae.7z

vijaymohan
Replied On November 4, 2019 05:43 AM UTC

Dear Sir,

Any update on this?

Regards
Vijay

Vignesh Natarajan [Syncfusion]
Replied On November 4, 2019 05:46 AM UTC

Hi VijayMohan,  

Greetings from Syncfusion support.  

Query: “Grid CellEdit Template does not work” 

We have analyzed the provided video demonstration, code example and found that ID property of EjsComboBox is different from the Field value. ID property of edit template component must be same as the Field value of that column.  

But in your sample, you have used ID property as one variable (“Id”) which is different from columns field (“ProductId”) property, hence the reported issue is occurred. Kindly modify the ID property as ProductId to resolve the issue.  

Refer the below modified code example.  

<GridColumn Field=@nameof(RequestProduct.ProductId) HeaderText="Product Name" ForeignKeyValue="Name" DataSource="@products" Width="150"> 
    <EditTemplate> 
        @{ 
            <EjsComboBox ID="ProductId" Value="@((context as RequestProduct).ProductId)" TValue="int?" DataSource="@products"> 
                <ComboBoxFieldSettings Text="Name" Value="Id"></ComboBoxFieldSettings> 
            </EjsComboBox> 
        } 
    </EditTemplate> 
</GridColumn> 

Also in your code example, you have not enabled IsPrimaryKey property to any of the available column. Based on the PrimaryKey column value only CRUD operation will take place. So IsPrimaryKey property must be define to any of available column which has unique values.  

Refer our UG documentation for your reference 



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