ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Selection with Grid inside Grid CRUD Popup
Title:
B
I
{code}
?
I'd like to create a grid with an editor that has a selection grid inside the editor. It's similar to https://demo.aspnetawesome.com/GridCrudDemo , but instead of a lookup for the chef input (for example), I would like to display a whole selection grid with paging functionality etc. The reason is that the list that must be selected from contains over 25K records, so a selection grid with paging etc is more appropriate. Is this possible?
Save Changes
Cancel
Benji
asked at 24 Dec 2018
Answers
B
I
{code}
?
yes, you can use the lookup grid https://demo.aspnetawesome.com/LookupDemo/Misc#Lookup-Grid another option is odropdown with remote search https://demo.aspnetawesome.com/AjaxRadioListDemo#oremotesearch
Save Changes
Cancel
Omu
answered at 24 Dec 2018
Thanks for your quick response. The demo at https://demo.aspnetawesome.com/LookupDemo/Misc#Lookup-Grid is exactly what I need, but I don't know how to get this into the grid editor. My understanding is that the Chef input at the https://demo.aspnetawesome.com/GridCrudDemo demo is displayed as a dropdown because the viewmodel input is decorated with [UIHint("Lookup")]? How would I go about configuring the editor to open a selection grid like in https://demo.aspnetawesome.com/LookupDemo/Misc#Lookup-Grid instead of a dropdown?
at 24 Dec 2018
Benji
you can see the code necessary for the lookup on the page (tabs under the lookup) you can also download the demo, if you want to use it using the `EditorFor` html helper you create a new view `Shared/EditorTemplates/MyLookupGrid.cshtml` and use it using `[UiHint("MyLookupGrid")]`
at 24 Dec 2018
Omu
Thanks again for your guidance and advice. I've gone ahead as you suggested and downloaded the Minsetup demo, and edited it so that the bonus meal input refers to a grid instead of the odropdown. Everything works well until I click on "ok" to add the new item, then it says that the bonus meal is required even though it is populated through the grid selection. I've uploaded the project here https://files.fm/u/xpgw55az . Can you please take a look and let me know where I'm going wrong? Thanks again in advance for all your help.
at 31 Dec 2018
Benji
the problem I saw in your demo was getting an error when clicking Edit on a row; the problem was your `MealLookupGrid.cshtml`, modify it to look like this: @{ Layout = "_FieldLayout"; } @(Html.Awe().Lookup("") .LookupGrid(Url.Action("MealLookup")) .Controller("MealLookup")) you probably noticed that all other editor templates have `""` for name, the error was that the value of `BonusMealId` was int but the `MeaLookupGrid.cshtml` was expecting a `LookupDemoInput`
at 31 Dec 2018
Omu
That worked! You guys are truly awesome! Thanks again for all your help, I'll post new questions if necessary going forward. Thanks again for all your help.
at 31 Dec 2018
Benji
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