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.
Unfortunately, activation email could not send to your email. Please try again.

MVC Grid edit problem with PrimaryKey and datasource

Thread ID:

Created:

Updated:

Platform:

Replies:

119050 May 6,2015 07:34 AM May 8,2015 12:52 AM ASP.NET MVC 3
loading
Tags: Grid
Juan Peiró Llobet
Asked On May 6, 2015 07:34 AM

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.


Gowthami V [Syncfusion]
Replied On May 7, 2015 05:06 AM

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.

Juan Peiró Llobet
Replied On May 7, 2015 09:14 AM

 

Hi Gowthami

Thank you very much for your atencion and your help

Best regards


Gowthami V [Syncfusion]
Replied On May 8, 2015 12:52 AM

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.

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.

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.

;