ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Grid Edit - Use ObjectId instead of Id in CRUD Demo
Title:
B
I
{code}
?
Hello, I have downloaded the application MvcMinSetupDemo ( http://aspnetawesome.com/Download/MvcMinSetupDemo ). In the data model Entities.cs, I have change the variable *Id* with *ObjectId*. I have change in the entity and controller the related lines to change Id into ObjectId. In the View Index.cshtml, I have changed the following line to update Id with ObjectId: new Column { Name = "ObjectId", Width = 55 } new Column{ClientFormat = GridUtils.EditFormatForGrid("DinnersGrid","ObjectId"), Width = 50}.Mod(o => o.Nohide()), new Column { ClientFormat = GridUtils.DeleteFormatForGrid("DinnersGrid", "ObjectId"), Width = 50 }.Mod(o => o.Nohide()))) After this changes, it is not possible anymore to edit or delete a record because the edit/delete window appears without any field. It seems that the grid control needs absolutely "Id" and it is not possible to change it to another name (which would be bad when used linked to a SQL database). How can I solve this ? Thanks.
Save Changes
Cancel
Alain Rime
asked at 20 Jan 2016
Answers
B
I
{code}
?
*december 2016 update:* this has been made easier and the crud controller in the latest mvcminsetup demo has all the explanation you need
Save Changes
Cancel
Omu
answered at 20 Jan 2016
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK