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 command do nat work in tabs(hosted core)

Thread ID:

Created:

Updated:

Platform:

Replies:

147957 Sep 29,2019 02:05 PM UTC Oct 7,2019 04:57 AM UTC Blazor 3
loading
Tags: Tabs
ebi torabi
Asked On September 29, 2019 02:05 PM UTC

<EjsGrid Width="100%" TValue="GridFields" DataSource="@GridData" EnableRtl="true" AllowTextWrap="true">
                                                    <GridEditSettings AllowAdding="true" AllowDeleting="true"></GridEditSettings>
                                                    <GridColumns>
                                                        <GridColumn Field=@nameof(GridFields.TrainNo) HeaderText="Train No" Width="120" Type="@ColumnType.Number"></GridColumn>
                                                        <GridColumn Field=@nameof(GridFields.Name) Width="140"></GridColumn>
                                                        <GridColumn HeaderText="حذف" Width="20">
                                                            <GridCommandColumns>
                                                                <GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-edit", CssClass="e-flat" })"></GridCommandColumn>
                                                                <GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-delete", CssClass="e-flat" })"></GridCommandColumn>
                                                                <GridCommandColumn Type="CommandButtonType.Save" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-save", CssClass="e-flat" })"></GridCommandColumn>
                        <GridCommandColumn Type="CommandButtonType.Cancel" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-cancel", CssClass="e-flat" })"></GridCommandColumn>
                                                            </GridCommandColumns>
                                                        </GridColumn>

                                                    </GridColumns>
                                                </EjsGrid>

Satheesh Kumar Balasubramanian [Syncfusion]
Replied On September 30, 2019 11:42 AM UTC

Hi Ebi, 
 
Greetings from Syncfusion support. 
 
We have validated the reported issue with shared code snippet and found that you have missed to set the properties  “AllowEditing” and “IsPrimaryKey” as true in GridEditSettings and GridColumn tag respectively which is the cause for the reported problem. 
 
Refer the below code snippet to overcome the reported issue.  
 
@using Syncfusion.EJ2.Blazor.Navigations 
@using Syncfusion.EJ2.Blazor.Grids 
 
<EjsTab> 
    <TabItems> 
        <TabItem> 
            <ChildContent> 
                <TabHeader Text="Grid"></TabHeader> 
            </ChildContent> 
            <ContentTemplate> 
                <EjsGrid TValue="GridFields" DataSource="@GridData" EnableRtl="true" AllowTextWrap="true"> 
                    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings> 
                    <GridColumns> 
                        <GridColumn Field=@nameof(GridFields.TrainNo) HeaderText="Train No" IsPrimaryKey="true" Width="120" Type="@ColumnType.Number"></GridColumn> 
                        <GridColumn Field=@nameof(GridFields.Name) Width="140"></GridColumn> 
                        <GridColumn HeaderText="حذف" Width="20"> 
                            <GridCommandColumns> 
                                <GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-edit", CssClass="e-flat" })"></GridCommandColumn> 
                                <GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-delete", CssClass="e-flat" })"></GridCommandColumn> 
                                <GridCommandColumn Type="CommandButtonType.Save" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-save", CssClass="e-flat" })"></GridCommandColumn> 
                                <GridCommandColumn Type="CommandButtonType.Cancel" ButtonOption="@(new CommandButtonOptions() {IconCss="e-icons e-cancel", CssClass="e-flat" })"></GridCommandColumn> 
                            </GridCommandColumns> 
                        </GridColumn> 
                    </GridColumns> 
                </EjsGrid> 
            </ContentTemplate> 
        </TabItem> 
    </TabItems> 
</EjsTab> 
 
 
@code{ 
    public List<GridFields> GridData { get; set; } 
 
    protected override void OnInitialized() 
    { 
        GridData = Enumerable.Range(1, 5).Select(x => new GridFields() 
        { 
            TrainNo = 1000 + x, 
            Name = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)] 
        }).ToList(); 
    } 
 
    public class GridFields 
    { 
        public int? TrainNo { get; set; } 
        public string Name { get; set; } 
    } 
 
} 
 
 
 
Please try out the solution and let us know if you need any further assistance. 
 
Regards, 
Satheesh Kumar B 


ebi torabi
Replied On October 4, 2019 05:28 PM UTC

Hi Satheesh Kumar B 
Thanks for your great support

Nevitha Ravi [Syncfusion]
Replied On October 7, 2019 04:57 AM UTC

Hi Ebi, 

You are most welcome.! Please let us know if you need any further assistance. 

Regards, 
Nevitha 


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