Example of Restaurant Menu in ASP.NET MVC Tree Grid Control
This demo shows how the Tree Grid can be used to create a visually rich and interactive food menu. The demo meets different viewer preferences, such as vegetarian and bestseller dishes. It uses a food dataset that includes details for categories like salads, pizza, burgers, hot-dogs, chowmein, and desserts, with descriptions, prices and ratings.
@Html.UiTreeGrid(new UiTreeGridOptions
{
Id = "FoodMenu",
Data = ViewData["datasource"],
IdMapping = "FoodId",
ParentIdMapping = "CategoryId",
TreeColumnIndex = 0,
Height = "400px",
AllowPaging = false,
Selection = UiGridSelection.Single,
OnQueryCellInfo = "queryCellInfo",
EmptyRecordTemplate = "#emptytemplate",
Columns = new List<UiGridColumn>
{
new UiGridColumn { Field = "FoodName", HeaderText = "Explore Our Menu", Width = 150 }
}
})
<style>
.border {
border-color: #e0e0e0;
border: 1px solid #e0e0e0;
border-width: 1px 0px 0px 0px;
}
img {
width: 60px;
height: 60px;
vertical-align: baseline;
border-radius: 50px;
margin-left: 20px;
background-repeat: no-repeat;
}
.tailwind3-dark #TreeGrid .e-table td.border,
.fluent2-dark #TreeGrid .e-table td.border,
.bootstrap5\.3-dark #TreeGrid .e-table td.border,
.material3-dark #TreeGrid .e-table td.border,
.fluent2-highcontrast #TreeGrid .e-table td.border {
color: #fff;
}
.e-gridheader .e-headercelldiv {
text-align: center;
font-weight: bold;
font-size: 16px;
letter-spacing: 2.45px !important;
}
:root {
--green: #27ae60;
--red: #e74c3c;
--radius: 12px;
--grey-line: #e5e7eb;
}
[class*="veg-icon"],
[class*="e-veg-icon"],
[class*="e-nonveg-icon"] {
display: inline-block;
border-radius: 50%;
}
[class*="veg-icon"] {
width: 12px;
height: 12px;
margin: 0 0 4px 2px;
}
.material3 [class*="veg-icon"],
.tailwind3 [class*="veg-icon"] {
margin: 0 0 2px 2px;
}
.resmenu-veg-icon {
background: green;
}
.resmenu-nonveg-icon {
background: red;
}
[class*="FoodCategory_icon"] {
width: 20px;
height: 20px;
border: 2px solid;
}
.resmenu-rating-thumbsup{
position: relative;
top: -2px;
}
.resmenu-FoodCategory_icon_veg {
border-color: green;
}
.resmenu-FoodCategory_icon_nonveg {
border-color: red;
}
.resmenu-e-veg-icon,
.resmenu-e-nonveg-icon {
border: 2px solid;
border-radius: 4px;
background: #fff;
position: relative;
}
.resmenu-e-veg-icon {
border-color: var(--green);
}
.resmenu-e-nonveg-icon {
border-color: var(--red);
}
.resmenu-e-veg-icon::after,
.resmenu-e-nonveg-icon::after {
content: '';
width: 10px;
height: 10px;
border-radius: 50%;
position: absolute;
top: 4px;
left: 4px;
}
.resmenu-e-veg-icon::after {
background: var(--green);
}
.resmenu-e-nonveg-icon::after {
background: var(--red);
}
.resmenu-price {
font-weight: bold;
}
.resmenu-old-price {
font-size: 12px;
text-decoration: line-through;
margin: 3px;
}
.resmenu-card {
width: 30vw;
padding: 10px;
margin-bottom: 50px;
}
.resmenu-info-separator {
margin: 20px 0 0 0;
}
.resmenu-cell {
border-bottom: 1px solid var(--grey-line);
}
.resmenu-image {
width: 110px;
height: 110px;
float: right;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
border-radius: var(--radius);
margin: 20px;
transition: transform .3s;
}
.resmenu-image-wrap {
display: flex;
flex-direction: column;
align-items: end;
}
.resmenu-image-wrap:hover .resmenu-image {
transform: scale(1.2);
}
.resmenu-count {
margin: 10px 20px 0 0;
}
.resmenu-food-count {
width: 60px;
text-align: center;
margin-top: 10px;
}
.resmenu-price-section {
text-align: right;
width: 28vw;
}
.resmenu-rating {
padding: 15px 0;
font-size: 13px;
font-weight: 400;
}
.resmenu-rating-value {
font-weight: 600;
font-size: 15px;
}
.resmenu-rating-thumbsup,
.resmenu-rating-count {
font-size: 15px;
}
.resmenu-foodname {
font-weight: 600;
font-size: 18px;
margin-left: 7px;
}
.resmenu-fooddesc {
font-weight: 400;
letter-spacing: .45px;
}
.resmenu-title {
float: right;
margin: 5px 0 0 5px;
font-weight: bold;
}
.resmenu-parentfoodname {
height: 48px;
font-weight: 800;
font-size: 18px;
}
#cartbadge {
top: -14px;
font-size: 10px;
}
.e-toolbar-right {
right: 20px !important;
}
#CartUpdate {
font-weight: 400;
font-size: 10px;
}
.treegrid-center-container,
.resmenu-toolbar-search {
width: 800px;
margin: 32px auto;
}
.resmenu-toolbar-search {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 16px;
box-shadow: rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
}
.resmenu-emptyRecord {
font-style: italic;
font-size: 20px;
}
#search-autocomplete {
height: 45px;
width: 100%;
padding: 8px 12px;
border-radius: 8px;
font-size: 16px;
}
#ingredientsList .e-chip.e-outline {
color: #222 !important;
border-color: #ccc !important;
background: #D3D3D3 !important;
box-shadow: none !important;
cursor: default !important;
transition: none !important;
}
@@media (max-width: 1200px) {
.treegrid-center-container,
.resmenu-toolbar-search {
width: 100%;
padding: 0 8px;
box-sizing: border-box;
}
}
#cartDialog_title {
text-align: center;
}
.treegrid-center-container .e-treegridexpand,
.treegrid-center-container .e-treegridcollapse {
vertical-align: middle !important;
margin-left: 7px;
}
.treegrid-center-container .e-toolbar {
height: 60px !important;
}
.material3-dark [class*="veg-icon"] {
margin: 0 0 3px 2px;
}
.material3 #search-autocomplete,
.material3-dark #search-autocomplete {
padding-top : 15px !important;
padding-bottom : 15px !important;
padding-left: 13px;
}
@@media print {
body {
font-family: sans-serif;
}
ul {
margin-bottom: 16px;
}
div {
margin-bottom: 4px;
}
}
@@media (max-width: 450px) {
.resmenu-image {
width: 60px;
height: 60px;
}
.resmenu-count {
margin: 0 5px 0 0;
}
.resmenu-price-section {
text-align: left;
}
}
.sample-order {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 15px;
}
.resmenu-order-no,
.resmenu-order-date {
font-weight: bold;
}
.resmenu-order-no {
font-size: medium;
}
.resmenu-thank-note {
font-weight: bold;
font-style: italic;
margin: 30px;
justify-items: center;
font-size: medium;
}
#dialog-container td {
padding: 5px 0;
}
</style>
<style>' +
'body {' +
'font-family: sans-serif;' +
'margin: 20px;' +
'box-sizing: border-box;' +
'}' +
'ul {' +
'margin-bottom: 16px;' +
'}' +
'div {' +
'margin-bottom: 4px;' +
'}' +
'</style>
<div class="resmenu-toolbar-search" style="display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:8px;">
<img src="@Url.Content("~/Content/images/treegrid/male.png")" alt="avatar" style="width:40px;height:40px;border-radius:50%;margin:0;" />
<input id="search-autocomplete" type="search" list="dishNames" placeholder="Search for dishes" style="flex:1 1 300px; max-width:800px;" />
<datalist id="dishNames"></datalist>
<button type="button" id="CartUpdate">VIEW CART <span id="cartbadge" class="e-cart-badge">0</span></button>
</div>
@Html.UiTreeGrid(new UiTreeGridOptions
{
Id = "FoodMenu",
Data = ViewData["datasource"],
IdMapping = "FoodId",
ParentIdMapping = "CategoryId",
TreeColumnIndex = 0,
Height = "400px",
AllowPaging = false,
Selection = UiGridSelection.Single,
OnQueryCellInfo = "queryCellInfo",
EmptyRecordTemplate = "#emptytemplate",
Columns = new List<UiGridColumn>
{
new UiGridColumn { Field = "FoodName", HeaderText = "Explore Our Menu", Width = 150 }
}
})
<template id="emptytemplate"><div class="emptyRecordTemplate"><span class="resmenu-emptyRecord">Hmm... we could not find that dish. Want to try something else?</span></div></template>
@{
var dishNames = new List<string>();
foreach (dynamic food in (IEnumerable<object>)ViewData["datasource"])
{
if (food.CategoryId != null) { dishNames.Add((string)food.FoodName); }
}
}
<dialog id="cartDialog" style="width:400px; max-width:95vw; border:1px solid #ccc; border-radius:8px; padding:0;">
<div style="display:flex; justify-content:space-between; align-items:center; padding:12px 16px; border-bottom:1px solid #e0e0e0;"><b>Bill Summary</b><button type="button" id="cartClose" aria-label="Close">×</button></div>
<div id="cartBody" style="padding:12px 16px; max-height:500px; overflow-y:auto;"></div>
<div style="display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid #e0e0e0;"><button type="button" id="cartCancel">Cancel</button><button type="button" id="cartPrint">Print</button></div>
</dialog>
<script>
var imageFolder = '@Url.Content("~/Content/images/treegrid/")';
var foodorderDetails = [];
var cartCount = 0;
function el(tag, className, text) {
var e = document.createElement(tag);
if (className) { e.className = className; }
if (text !== undefined) { e.textContent = text; }
return e;
}
function tree() { return window.Lumen.get('FoodMenu'); }
function foodItem(name) { return foodorderDetails.filter(function (i) { return i.foodName.toLowerCase() === name.toLowerCase(); })[0]; }
// Syncfusion's row template: a category row (its title and how many dishes), or a dish with its rating, text, ingredients, price and photo with a count box.
function queryCellInfo(args) {
if (args.column !== 'FoodName') { return; }
var d = args.data;
var box = el('div');
if (d.CategoryId === null || d.CategoryId === undefined) {
var title = el('span', 'resmenu-title', d.FoodName + ' ');
title.appendChild(el('span', '', '(' + ((d.VegCount || 0) + (d.NonvegCount || 0)) + ')'));
box.appendChild(title);
args.content = box;
return;
}
box.className = 'resmenu-card-row';
box.style.cssText = 'display:flex; align-items:center; gap:16px; padding:8px 0;';
var card = el('div', 'resmenu-card');
card.style.flex = '1 1 auto';
var nameRow = el('div', 'foodname-row');
nameRow.style.display = 'flex';
var icon = el('span', d.FoodType === 'Veg' ? 'resmenu-FoodCategory_icon_veg' : 'resmenu-FoodCategory_icon_nonveg');
icon.appendChild(el('span', d.FoodType === 'Veg' ? 'resmenu-veg-icon' : 'resmenu-nonveg-icon'));
nameRow.appendChild(icon);
nameRow.appendChild(el('span', 'resmenu-foodname', d.FoodName));
card.appendChild(nameRow);
var rating = el('div', 'resmenu-rating');
rating.appendChild(el('span', 'resmenu-rating-thumbsup', '\uD83D\uDC4D'));
rating.appendChild(document.createTextNode(' '));
rating.appendChild(el('span', 'resmenu-rating-value', String(d.Rating)));
rating.appendChild(el('span', 'resmenu-rating-count', ' (' + d.TotalReviews + ')'));
card.appendChild(rating);
card.appendChild(el('div', 'resmenu-fooddesc', d.FoodDescription));
var chips = el('div', 'resmenu-info-separator');
(d.Ingredients || []).forEach(function (ingredient) {
var chip = el('span', 'resmenu-chip', ingredient);
chip.style.cssText = 'display:inline-block; margin:0 4px 2px 0; padding:1px 10px; border:1px solid #b0b0b0; border-radius:12px; font-size:12px;';
chips.appendChild(chip);
});
card.appendChild(chips);
box.appendChild(card);
var price = el('div', 'resmenu-price-section');
price.appendChild(el('span', 'resmenu-price', '$' + d.NewPrice));
if (d.OriginalPrice > d.NewPrice) { price.appendChild(el('span', 'resmenu-old-price', '$' + d.OriginalPrice)); }
box.appendChild(price);
var wrap = el('div', 'resmenu-image-wrap');
var img = el('img', 'resmenu-image');
// the data says where the picture is (@Url.Content("~/Content/images/treegrid/house-salad")): its name is what counts
var picture = String(d.Image).split('/').pop();
img.src = imageFolder + encodeURIComponent(picture) + '.png';
img.alt = picture;
wrap.appendChild(img);
var count = document.createElement('input');
count.type = 'number';
count.min = 0;
count.max = 10;
count.step = 1;
count.className = 'resmenu-food-count';
count.setAttribute('aria-label', 'Count of ' + d.FoodName);
var known = foodItem(d.FoodName);
count.value = known ? known.count : 0;
count.style.width = '70px';
// Syncfusion's foodCountChangeFn: the cart count follows each step; the dish is kept with its price and count.
count.addEventListener('change', function () {
var value = Math.max(0, Math.min(10, parseInt(count.value, 10) || 0));
var item = foodItem(d.FoodName);
var previous = item ? item.count : 0;
count.value = value;
cartCount += value - previous;
document.getElementById('cartbadge').textContent = cartCount;
if (item) { item.count = value; item.price = d.NewPrice; } else { foodorderDetails.push({ foodName: d.FoodName, price: d.NewPrice, count: value }); }
});
['mousedown', 'click', 'dblclick'].forEach(function (name) { count.addEventListener(name, function (e) { e.stopPropagation(); }); });
wrap.appendChild(count);
box.appendChild(wrap);
args.content = box;
}
// The dish names for the search list.
var allDishes = @Html.Raw(UiJson.Serialize(dishNames));
allDishes.forEach(function (name) {
var option = document.createElement('option');
option.value = name;
document.getElementById('dishNames').appendChild(option);
});
// Syncfusion's AutoComplete filters the menu to the dishes (and categories) that contain the text.
document.getElementById('search-autocomplete').addEventListener('change', function (e) { tree().search(e.target.value); });
document.getElementById('search-autocomplete').addEventListener('input', function (e) { if (!e.target.value) { tree().search(''); } });
function cartTable(items) {
var wrap = el('div');
if (!items.length) {
var none = el('div', '', 'No items in cart.');
none.style.cssText = 'padding:20px; text-align:center;';
wrap.appendChild(none);
return wrap;
}
var order = el('div', 'sample-order');
order.appendChild(el('div', 'resmenu-order-no', 'Order No: ' + (Math.floor(Math.random() * 90) + 100)));
order.appendChild(el('div', '', 'Date: ' + new Date().toLocaleDateString()));
wrap.appendChild(order);
var table = el('table');
table.style.cssText = 'width:100%; border-collapse:collapse;';
var head = el('tr');
['Dish', 'Price', 'Qty', 'Total'].forEach(function (h) { head.appendChild(el('th', '', h)); });
table.appendChild(head);
var total = 0;
items.forEach(function (item) {
var row = el('tr');
row.appendChild(el('td', '', item.foodName));
row.appendChild(el('td', '', '$' + item.price));
row.appendChild(el('td', '', String(item.count)));
row.appendChild(el('td', '', '$' + (item.price * item.count).toFixed(2)));
table.appendChild(row);
total += item.price * item.count;
});
wrap.appendChild(table);
total = Math.round(total);
var delivery = 3.6, gst = Math.round(total * 0.12 * 100) / 100;
[['Item Total', '$' + total], ['Delivery Fee', '$' + delivery], ['TAX & Other Charges', '$' + gst], ['TO PAY', '$' + (Math.round((total + delivery + gst) * 100) / 100)]].forEach(function (line, i) {
var row = el('div');
row.style.cssText = 'display:flex; justify-content:space-between; margin-top:4px;' + (i === 3 ? 'font-weight:bold; font-size:18px; border-top:2px solid #beb5b5; padding-top:8px;' : '');
row.appendChild(el('span', '', line[0]));
row.appendChild(el('span', '', line[1]));
wrap.appendChild(row);
});
wrap.appendChild(el('div', 'resmenu-thank-note', 'Thank you for your order!'));
return wrap;
}
function inCart() { return foodorderDetails.filter(function (i) { return i.count > 0; }); }
var dialog = document.getElementById('cartDialog');
document.getElementById('CartUpdate').addEventListener('click', function () {
var body = document.getElementById('cartBody');
body.textContent = '';
body.appendChild(cartTable(inCart()));
document.getElementById('cartPrint').disabled = inCart().length === 0;
dialog.showModal();
});
document.getElementById('cartClose').addEventListener('click', function () { dialog.close(); });
// Syncfusion's Cancel empties the cart.
document.getElementById('cartCancel').addEventListener('click', function () {
foodorderDetails.forEach(function (item) { item.count = 0; });
cartCount = 0;
document.getElementById('cartbadge').textContent = 0;
document.querySelectorAll('.resmenu-food-count').forEach(function (box) { box.value = 0; });
dialog.close();
});
document.getElementById('cartPrint').addEventListener('click', function () { window.print(); });
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Lumen.UI.Mvc;
namespace YourApp.Controllers
{
public class TreeGridController : Controller
{
// The page is Views/TreeGrid/RestaurantMenu.cshtml; it draws what ViewData holds.
public ActionResult RestaurantMenu()
{
ViewData["datasource"] = RestaurantMenus.GetMenuItems();
return View();
}
public class RestaurantMenus
{
// Parameterless constructor
public RestaurantMenus() { }
// Parameterized constructor
public RestaurantMenus(int foodId, string foodCategory, string foodName, string foodType,
double newPrice, double originalPrice, string image, int? categoryId,
double rating, int totalReviews, string foodDescription, bool isBestseller,
int vegCount, int nonvegCount, List<string> ingredients)
{
this.FoodId = foodId;
this.FoodCategory = foodCategory;
this.FoodName = foodName;
this.FoodType = foodType;
this.NewPrice = newPrice;
this.OriginalPrice = originalPrice;
this.Image = image;
this.CategoryId = categoryId;
this.Rating = rating;
this.TotalReviews = totalReviews;
this.FoodDescription = foodDescription;
this.IsBestseller = isBestseller;
this.VegCount = vegCount;
this.NonvegCount = nonvegCount;
this.Ingredients = ingredients;
}
// Properties
public int FoodId { get; set; }
public string FoodCategory { get; set; }
public string FoodName { get; set; }
public string FoodType { get; set; }
public double NewPrice { get; set; }
public double OriginalPrice { get; set; }
public string Image { get; set; }
public int? CategoryId { get; set; }
public double Rating { get; set; }
public int TotalReviews { get; set; }
public string FoodDescription { get; set; }
public bool IsBestseller { get; set; }
public int VegCount { get; set; }
public int NonvegCount { get; set; }
public List<string> Ingredients { get; set; }
// Method to get all records
public static List<RestaurantMenus> GetMenuItems()
{
List<RestaurantMenus> menuList = new List<RestaurantMenus>
{
new RestaurantMenus(1, "Salads", "Salads", "Veg", 0, 0, "", null, 0, 0, "", false, 2, 4, new List<string>()),
new RestaurantMenus(2, "Salads", "House Salad", "Veg", 7.99, 9.99, "../Content/images/treegrid/house-salad", 1, 4.5, 120, "A refreshing blend of crisp lettuce, cherry tomatoes, cucumbers, and carrots.", true, 0, 0, new List<string> { "Lettuce", "Tomatoes", "Cucumbers", "Carrots" }),
new RestaurantMenus(3, "Salads", "Cranberry Chicken Salad", "Non-veg", 13.99, 0, "../Content/images/treegrid/cranberry-chicken-salad", 1, 4.6, 110, "Grilled chicken breast with mixed greens and dried cranberries.", true, 0, 0, new List<string> { "Chicken breast", "Mixed greens", "Cranberries" }),
new RestaurantMenus(4, "Salads", "Chili Chicken Steamed", "Non-veg", 12.49, 14.49, "../Content/images/treegrid/chili-chicken-steamed", 1, 4.4, 90, "Steamed chicken tossed with green chilies and garlic.", false, 0, 0, new List<string> { "Chicken", "Green chilies", "Garlic" }),
new RestaurantMenus(5, "Salads", "Spinach Salad", "Veg", 8.99, 0, "../Content/images/treegrid/spinach-salad", 1, 4.3, 80, "Fresh baby spinach, cherry tomatoes, and walnuts.", false, 0, 0, new List<string> { "Spinach", "Tomatoes", "Walnuts" }),
new RestaurantMenus(6, "Salads", "Caesar Salad", "Non-veg", 10.99, 12.99, "../Content/images/treegrid/caesar-salad", 1, 4.7, 140, "Romaine lettuce with Parmesan and croutons.", true, 0, 0, new List<string> { "Romaine lettuce", "Parmesan", "Croutons" }),
new RestaurantMenus(7, "Salads", "Blue Chicken Salad", "Non-veg", 12.99, 14.99, "../Content/images/treegrid/blue-chicken-salad", 1, 4.2, 60, "Grilled chicken, blue cheese, and mixed greens.", false, 0, 0, new List<string> { "Chicken", "Blue cheese", "Mixed greens" }),
// Pizza Category
new RestaurantMenus(8, "Pizza", "Pizza", "Veg", 0, 0, "", null, 0, 0, "", false, 3, 3, new List<string>()),
new RestaurantMenus(9, "Pizza", "Veggie Pizza", "Veg", 14.99, 0, "../Content/images/treegrid/veggie-pizza", 8, 4.6, 100, "Bell peppers, onions, olives, and mozzarella cheese.", true, 0, 0, new List<string> { "Bell peppers", "Onions", "Olives", "Mozzarella" }),
new RestaurantMenus(10, "Pizza", "Margherita Pizza", "Veg", 13.99, 0, "../Content/images/treegrid/margherita-pizza", 8, 4.7, 120, "Fresh mozzarella, tomato sauce, and basil.", true, 0, 0, new List<string> { "Mozzarella", "Tomato sauce", "Basil" }),
new RestaurantMenus(11, "Pizza", "Quattro Formaggi Pizza", "Veg", 15.99, 18.99, "../Content/images/treegrid/quattro-formaggi", 8, 4.8, 80, "Mozzarella, cheddar, parmesan, and blue cheese.", false, 0, 0, new List<string> { "Mozzarella", "Cheddar", "Parmesan", "Blue cheese" }),
new RestaurantMenus(12, "Pizza", "Capricciosa Pizza", "Non-veg", 16.99, 0, "../Content/images/treegrid/capricciosa-pizza", 8, 4.5, 60, "Ham, mushrooms, artichokes, and olives.", false, 0, 0, new List<string> { "Ham", "Mushrooms", "Artichokes", "Olives" }),
new RestaurantMenus(13, "Pizza", "Pepperoni Pizza", "Non-veg", 15.99, 0, "../Content/images/treegrid/pepperoni-pizza", 8, 4.9, 140, "Pepperoni and mozzarella cheese.", true, 0, 0, new List<string> { "Pepperoni", "Mozzarella" }),
new RestaurantMenus(14, "Pizza", "BBQ Chicken Pizza", "Non-veg", 16.49, 19.49, "../Content/images/treegrid/bbq-chicken-pizza", 8, 4.8, 110, "BBQ chicken, onions, and mozzarella.", false, 0, 0, new List<string> { "Chicken", "Onions", "Mozzarella" }),
// Burger Category
new RestaurantMenus(15, "Burger", "Burger", "Veg", 0, 0, "", null, 0, 0, "", false, 2, 7, new List<string>()),
new RestaurantMenus(16, "Burger", "Cheeseburger", "Non-veg", 8.99, 10.99, "../Content/images/treegrid/cheese-burger", 15, 4.5, 90, "Beef patty with cheese, lettuce, and tomato.", true, 0, 0, new List<string> { "Beef patty", "Cheese", "Lettuce", "Tomato" }),
new RestaurantMenus(17, "Burger", "Smash Burger", "Non-veg", 9.99, 0, "../Content/images/treegrid/smash-burger", 15, 4.6, 80, "Double beef patties with cheese and pickles.", false, 0, 0, new List<string> { "Beef patties", "Cheese", "Pickles" }),
new RestaurantMenus(18, "Burger", "Butter Burger", "Non-veg", 8.99, 10.99, "../Content/images/treegrid/butter-burger", 15, 4.4, 70, "Beef patty with buttery glaze and lettuce.", false, 0, 0, new List<string> { "Beef patty", "Butter", "Lettuce" }),
new RestaurantMenus(19, "Burger", "Chili Burger", "Non-veg", 9.49, 11.49, "../Content/images/treegrid/chili-burger", 15, 4.3, 60, "Chili beef patty with jalapeños and cheese.", false, 0, 0, new List<string> { "Beef patty", "Jalapeños", "Cheese" }),
new RestaurantMenus(20, "Burger", "Veggie Burger", "Veg", 7.99, 0, "../Content/images/treegrid/veggie-burger", 15, 4.2, 50, "Vegetable patty with lettuce and tomato.", false, 0, 0, new List<string> { "Vegetable patty", "Lettuce", "Tomato" }),
new RestaurantMenus(21, "Burger", "Black Bean Burger", "Veg", 8.49, 0, "../Content/images/treegrid/black-bean-burger", 15, 4.1, 40, "Black bean patty with greens and tomato.", false, 0, 0, new List<string> { "Black bean patty", "Greens", "Tomato" }),
new RestaurantMenus(22, "Burger", "Mushroom Burger", "Veg", 8.99, 10.99, "../Content/images/treegrid/mushroom-burger", 15, 4.3, 30, "Mushroom patty with Swiss cheese and lettuce.", false, 0, 0, new List<string> { "Mushroom patty", "Swiss cheese", "Lettuce" }),
new RestaurantMenus(23, "Burger", "Salmon Burger", "Non-veg", 11.99, 0, "../Content/images/treegrid/salmon-burger", 15, 4.5, 20, "Salmon patty with lettuce and tomato.", false, 0, 0, new List<string> { "Salmon patty", "Lettuce", "Tomato" }),
new RestaurantMenus(24, "Burger", "Chicken Burger", "Non-veg", 9.99, 11.99, "../Content/images/treegrid/chicken-burger", 15, 4.6, 60, "Chicken fillet with lettuce.", true, 0, 0, new List<string> { "Chicken fillet", "Lettuce" }),
// Hot Dogs Category
new RestaurantMenus(25, "Hot Dogs", "Hot Dogs", "Veg", 0, 0, "", null, 0, 0, "", false, 1, 5, new List<string>()),
new RestaurantMenus(26, "Hot Dogs", "Classic Hot Dog", "Non-veg", 5.99, 7.99, "../Content/images/treegrid/classic-hot-dog", 25, 4.6, 60, "Hot dog sausage in a bun.", true, 0, 0, new List<string> { "Hot dog sausage", "Bun" }),
new RestaurantMenus(27, "Hot Dogs", "Onion Dog", "Non-veg", 6.49, 0, "../Content/images/treegrid/onion-dog", 25, 4.6, 60, "Hot dog with caramelized onions.", true, 0, 0, new List<string> { "Hot dog sausage", "Bun", "Onions" }),
new RestaurantMenus(28, "Hot Dogs", "Bacon Dog", "Non-veg", 7.49, 9.49, "../Content/images/treegrid/bacon-dog", 25, 4.6, 60, "Hot dog wrapped in bacon.", true, 0, 0, new List<string> { "Hot dog sausage", "Bacon", "Bun" }),
new RestaurantMenus(29, "Hot Dogs", "BBQ Veggie Dog", "Veg", 6.99, 0, "../Content/images/treegrid/bbq-veggie-dog", 25, 4.6, 60, "Veggie sausage with BBQ sauce.", true, 0, 0, new List<string> { "Veggie sausage", "Bun" }),
new RestaurantMenus(30, "Hot Dogs", "Cheese Hot Dog", "Non-veg", 6.99, 8.99, "../Content/images/treegrid/cheese-hot-dog", 25, 4.6, 60, "Hot dog with melted cheese.", true, 0, 0, new List<string> { "Hot dog sausage", "Cheese", "Bun" }),
new RestaurantMenus(31, "Hot Dogs", "Chili Dog", "Non-veg", 7.49, 9.49, "../Content/images/treegrid/chili-dog", 25, 4.6, 60, "Hot dog topped with chili.", true, 0, 0, new List<string> { "Hot dog sausage", "Chili", "Bun" }),
// Chowmein Category
new RestaurantMenus(32, "Chowmein", "Chowmein", "Veg", 0, 0, "", null, 0, 0, "", false, 0, 11, new List<string>()),
new RestaurantMenus(33, "Chowmein", "Manchurian Chicken Chowmein", "Non-veg", 12.99, 0, "../Content/images/treegrid/manchurian-chowmein", 32, 4.4, 60, "Noodles with chicken and vegetables.", false, 0, 0, new List<string> { "Noodles", "Chicken", "Vegetables" }),
new RestaurantMenus(34, "Chowmein", "Fish Chowmein", "Non-veg", 13.49, 0, "../Content/images/treegrid/fish-chowmein", 32, 4.3, 55, "Noodles with fish and vegetables.", false, 0, 0, new List<string> { "Noodles", "Fish", "Vegetables" }),
new RestaurantMenus(35, "Chowmein", "Paneer and Chicken Chowmein", "Non-veg", 13.99, 0, "../Content/images/treegrid/paneer-chowmein", 32, 4.2, 40, "Noodles with paneer, chicken, and vegetables.", false, 0, 0, new List<string> { "Noodles", "Paneer", "Chicken" }),
new RestaurantMenus(36, "Chowmein", "Egg Chowmein", "Non-veg", 11.99, 0, "../Content/images/treegrid/egg-chowmein", 32, 4.5, 50, "Noodles with scrambled eggs and vegetables.", false, 0, 0, new List<string> { "Noodles", "Eggs", "Vegetables" }),
new RestaurantMenus(37, "Chowmein", "Chicken Chowmein", "Non-veg", 12.99, 14.99, "../Content/images/treegrid/chicken-chowmein", 32, 4.6, 70, "Noodles with chicken and vegetables.", false, 0, 0, new List<string> { "Noodles", "Chicken", "Vegetables" }),
new RestaurantMenus(38, "Chowmein", "Chili Garlic Chicken Chowmein", "Non-veg", 13.49, 15.49, "../Content/images/treegrid/chilli-garlic-chowmein", 32, 4.3, 45, "Spicy noodles with chicken and garlic.", false, 0, 0, new List<string> { "Noodles", "Chicken", "Garlic" }),
new RestaurantMenus(39, "Chowmein", "Tandoori Chicken Chowmein", "Non-veg", 13.99, 0, "../Content/images/treegrid/tandoori-chicken-chowmein", 32, 4.2, 35, "Noodles with tandoori chicken.", false, 0, 0, new List<string> { "Noodles", "Tandoori chicken" }),
new RestaurantMenus(40, "Chowmein", "Sichuan Chicken Chowmein", "Non-veg", 13.49, 15.49, "../Content/images/treegrid/sichuan-chowmein", 32, 4.1, 30, "Spicy Sichuan noodles with chicken.", false, 0, 0, new List<string> { "Noodles", "Chicken" }),
new RestaurantMenus(41, "Chowmein", "Shrimp Chowmein", "Non-veg", 14.99, 16.99, "../Content/images/treegrid/shrimp-chowmein", 32, 4.5, 25, "Noodles with shrimp and vegetables.", false, 0, 0, new List<string> { "Noodles", "Shrimp", "Vegetables" }),
new RestaurantMenus(42, "Chowmein", "Hakka Mutton Chowmein", "Non-veg", 13.99, 15.99, "../Content/images/treegrid/hakka-chowmein", 32, 4.3, 40, "Hakka noodles with mutton.", false, 0, 0, new List<string> { "Noodles", "Mutton" }),
new RestaurantMenus(43, "Chowmein", "Tandoori Prawn Chowmein", "Non-veg", 14.99, 16.99, "../Content/images/treegrid/tandoori-prawn-chowmein", 32, 4.2, 35, "Noodles with tandoori prawn.", false, 0, 0, new List<string> { "Noodles", "Prawn" }),
// Desserts Category
new RestaurantMenus(44, "Desserts", "Desserts", "Veg", 0, 0, "", null, 0, 0, "", false, 6, 0, new List<string>()),
new RestaurantMenus(46, "Desserts", "Chocolate Truffles", "Veg", 5.99, 0, "../Content/images/treegrid/chocolate-truffles", 44, 4.8, 60, "Chocolate ganache rolled in cocoa.", false, 0, 0, new List<string> { "Chocolate", "Cream" }),
new RestaurantMenus(47, "Desserts", "Brownies", "Veg", 4.99, 5.99, "../Content/images/treegrid/brownies", 44, 4.6, 50, "Fudgy chocolate brownies.", false, 0, 0, new List<string> { "Chocolate", "Flour" }),
new RestaurantMenus(48, "Desserts", "Gelato", "Veg", 5.49, 6.49, "../Content/images/treegrid/gelato", 44, 4.7, 40, "Italian-style ice cream.", false, 0, 0, new List<string> { "Milk", "Sugar" }),
new RestaurantMenus(49, "Desserts", "Sorbet", "Veg", 4.99, 0, "../Content/images/treegrid/sorbet", 44, 4.5, 30, "Refreshing fruit sorbet.", false, 0, 0, new List<string> { "Fruit", "Sugar" }),
new RestaurantMenus(50, "Desserts", "Fruit Tart", "Veg", 5.99, 7.99, "../Content/images/treegrid/fruit-tart", 44, 4.6, 20, "Tart shell with custard and fresh fruits.", false, 0, 0, new List<string> { "Tart shell", "Custard", "Fruits" })
};
return menuList;
}
}
}
}
@* Install once: Install-Package Lumen.UI.Mvc (or: dotnet add package Lumen.UI.Mvc) *@
@* Views/Web.config: <add namespace="Lumen.UI.Mvc" /> *@
@* Views/Shared/_Layout.cshtml *@
<head>
@Html.UiStyles()
<link rel="stylesheet" href="~/Content/site.css" />
</head>
<body>
@RenderBody()
@Html.UiScripts()
@RenderSection("scripts", required: false)
</body>
The sample shows how dynamic, customizable row templates and custom cell rendering make the menu more informative and attractive. The Tree Grid row template adds visual elements like images, ratings, and price comparisons right in the cells. With its flexibility and easy customization, the Tree Grid is a great tool for creating interesting and engaging food menu presentations.