ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How to Map in Grid (inline Mod)
Title:
B
I
{code}
?
I have a lot of Key Tables, which I want to edit in Grid control with inline Edit function. I'm not sure how to map my Id column, since the ID Columns in my Key tables have different names e.g. FruitId or VegId not just Id.
Save Changes
Cancel
TT Tom
asked at 15 Nov 2015
Answers
B
I
{code}
?
using the Main demo, add to Dinner class this property: public int DinnerId { get { return Id; } set { Id = value; } } in the view (GridInlineEditDemo/Index.cshtml) change the Id column: new Column { Bind = "DinnerId", Width = 75, Header = "Id"}.Mod(o => o.InlineId(modelProp:"Id")) in GridInlineEditDemoController.cs GridGetItems change Key = "DinnerId" and in MapToGridModel o.Id change to o.DinnerId in GridUtils.cs DeleteFormat method change {1}: '.{1}' to id: '.{1}' in utils.js itemDeleted method change to $grid.data('api').select(res["Id"]) ( replace key with "Id" ) --- for the edit/create it was enough to add modelProp:"Id" and set the correct Key for delete I changed the code so that it will always use "Id" instead of "GridKey", so that the Delete actions will look the same for all entities --- btw if you're using EF you could just map you table column to Id instead of FruitId
Save Changes
Cancel
Omu
answered at 16 Nov 2015
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