I am creating a tree view for a flat table. I have a linq query which returns all distinct values from a column
public ActionResult Index()
{
var result = (from i in db.Items
select i.GeoName)
.Distinct()
.OrderBy(n => n);
return View(result);
}
This of course returns a view with my beginning nodes (lets hypothetically say 'Node1', 'Node2', and 'Node3').
I would like to then have the user click on a node, and return the contents of that column as well.
How do you do this dynamically?
I was hoping it was as simple (and may well be, I don't know - LINQ newb!) as:
public ActionResult Index()
{
var result = (from i in db.Items
select i.passedInColumnName)
.Distinct()
.OrderBy(n => n);
return View(result);
}
As always, thanks in advance to you helpful folks.