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
close icon

MVC Grid edit problem with PrimaryKey and datasource

Hi

We are using version 12.4.0.30 of MVC Grid and we have a MVC like the example:

@(Html.EJ().Grid<T_HCP_HCO_CONFIG>("GrdMaster")

            .Datasource((IEnumerable<object>)ViewBag.GridDS)

            .EditSettings(edit =>

            {

                edit.AllowAdding().AllowDeleting().AllowEditing();

            })

 

            .ToolbarSettings(toolbar =>

            {

                toolbar.ShowToolbar().ToolbarItems(items =>

                {

                    items.AddTool(ToolBarItems.Add);

                    items.AddTool(ToolBarItems.Edit);

                    items.AddTool(ToolBarItems.Delete);

                    items.AddTool(ToolBarItems.Update);

                    items.AddTool(ToolBarItems.Cancel);

                });

            })

            .AllowPaging(true).PageSettings(page => page.PageSize(15))

            .AllowFiltering(true).FilterSettings(filter => { filter.FilterType(FilterType.Menu); })

            .AllowSorting(true)

            .Columns(col =>

            {

                col.Field("ID_COUNTRY").HeaderText("Country").IsPrimaryKey(true).TextAlign(TextAlign.Left).ForeignKeyField("ID").ForeignKeyValue("DESCRIPTION").DataSource((IEnumerable<object>)ViewBag.CountriesDS).Width(90).ValidationRules(v => v.AddRule("required", true)).Add();

 

col.Field("ID_TYPE").HeaderText("Type").IsPrimaryKey(true).DefaultValue(0).ValidationRules(v => v.AddRule("required", true)).Add();

 

col.Field("UCI_FIELD").HeaderText("UCI").Width(100).TextAlign(TextAlign.Left).ValidationRules(v => v.AddRule("required", true)).Add();

               

            })

            .ClientSideEvents(eve =>

            {

                eve.EndAdd("GrdMaster_Add");

                eve.RowSelected("GrdMaster_Select");

                eve.EndEdit("GrdMaster_Edit");

                eve.ToolbarClick("GrdMaster_Click");

            })

        )

    </div>

 

But when we edit grid, an error appears;

 

TypeError: u.find(...).get(...) is undefined

 

...;u.find(".e-editcell").get(0).colSpan=d-v.find("td").not(":visible").length+h;v....

 

It seems, that the problem is with the PrimaryKey field, that is showed with a DataSource combo.


3 Replies

GV Gowthami V Syncfusion Team May 7, 2015 09:06 AM UTC

Hi Juan,

Thanks for using Syncfusion products.

We considered the issue “Script error throws while editing the row when enable primarykey and foreignkey for the same column” as a bug. We have logged a report on this and will fix the issue internally, also the fix will be included in Vol 1, 2015 service pack 2 release, which has been scheduled to be rolled out at the end of month May 2015.

We have also created an incident internally to have a follow up with this issue.

Please let us know if you have any other concerns.

Regards,
Gowthami V.


JP Juan Peiró Llobet May 7, 2015 01:14 PM UTC

 

Hi Gowthami

Thank you very much for your atencion and your help

Best regards



GV Gowthami V Syncfusion Team May 8, 2015 04:52 AM UTC

Hi Juan,

Thanks for your update.

Please get back to us if you need further assistance. We will happy to assist you.

Regards,
Gowthami V.

Loader.
Live Chat Icon For mobile
Up arrow icon