ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Show different editor in grid inline editing column for Create/Edit
Title:
B
I
{code}
?
I am trying inline editing in the grid, my case is that I want to display a column which should show a readonly value when I click on edit button and a lookup when I click on create button
Save Changes
Cancel
SalesARM
asked at 24 Mar 2020
Answers
B
I
{code}
?
you need to do something similar to the Date column from this demo: https://demo.aspnetawesome.com/GridInlineEditDemo/ConditionalDemo except instead of a datepicker you'll use a Lookup and in the dateCond function (which you should rename) you can check on a boolean property on the row model like: function dateCond(o, params) { if (!o.Creating) return params[0]; // readonly return params[1]; // lookup } all you have to now is set the `Creating` property on the create row model: @Html.InlineCreateButtonForGrid(grid, new { Creating = true })
Save Changes
Cancel
Omu
answered at 24 Mar 2020
I have tried but InlineFunc doesn't exist in my older version (below v. 5). Is there any other way new Column { Bind = "Date", Width = 170 } .Mod(o => o.InlineFunc("dateCond", // cannot use this code f => f.Param(p => p.Inline("<input type='hidden' name='Date' value='#Value'/>#Value")) .Param(p => p.Inline(Html.Awe().DatePicker("Date"))) )),
at 25 Mar 2020
SalesARM
if it's not present in your version than no, the easiest thing to do is to update the project
at 25 Mar 2020
Omu
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