Selection with Grid inside Grid CRUD Popup
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?
Benji
asked
at 24 Dec 2018
Answers
-
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#oremotesearchOmuanswered 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 theat 24 Dec 2018 Omu
EditorFor
html helper you create a new viewShared/EditorTemplates/MyLookupGrid.cshtml
and use it using[UiHint("MyLookupGrid")]
-
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 yourat 31 Dec 2018 Omu
MealLookupGrid.cshtml
, modify it to look like this:@{
you probably noticed that all other editor templates have
Layout = "_FieldLayout";
}
@(Html.Awe().Lookup("")
.LookupGrid(Url.Action("MealLookup"))
.Controller("MealLookup"))""
for name, the error was that the value ofBonusMealId
was int but theMeaLookupGrid.cshtml
was expecting aLookupDemoInput
-
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
-