0

It's going to be a long one so apologies in advance. In an ASP.NET MVC application I am writing a partial control that is a search panel. Now this panel has

  1. classes selection drop-down but with table instead of list (table has a checkbox, and two columns with group headers - classname and no.of students)
  2. year selection as dropdownlist (hopefully the easiest of all)
  3. Indicators list with checkboxes and group headers

I have defined a View model as follows

public class SearchControlModel
{
    public List<Class> Classes {get; set;}
    public List<Year> Years { get; set; }
    public List<Indicator> Indicators { get; set; }
 }

Where my entities are:

public class Class
{

    public int classID { get; set; }
    public Nullable<int> grade { get; set; }
    public string classname { get; set; }
    public virtual ICollection<Student> Students { get; set; }
}

public class Indicator
{
    public int IndicatorID { get; set; }
    public string IndicatorDescription { get; set; }

    public virtual ICollection<Student> Students { get; set; }

}

My questions are:

  1. What would be the right controls to display class and indicators (grid/table that appears as a drop-down)

  2. Do I use the ado.net entities directly or through stored procedures?

  3. If I use stored procedures, I will have to define a different entity that has only the specific properties that the stored procedure is dealing with or is there another way?

  4. On the View (cshtml file) how do I use these properties to bind with drop-down or table e.g. something like:

    • @Html.LabelFor(m => m.Classes)
    • @Html.DropDownListFor(m => m.Classes, new { @class = "form-control" })

In short what is the best approach to go about it?

Here is a picture to clarify

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Samra
  • 1,815
  • 4
  • 35
  • 71
  • Firstly, your view model is not correct. In order to create a ` –  Mar 20 '17 at 03:45
  • Secondly, the `DropDownListFor()` method creates a ` –  Mar 20 '17 at 03:45
  • Third, you question is far too broad (and you have asked 4 of them) and opinion based. –  Mar 20 '17 at 03:46
  • I see jquery plug-in hmm i have a kendo license can you recommend any kendo control that suits my need and alright i got your point about select property! thanks – Samra Mar 20 '17 at 03:48
  • Asking for recommendations are off-topic :) You need to do your own research. –  Mar 20 '17 at 03:52
  • to create a – Samra Mar 20 '17 at 03:56
  • Yes, but that will just display a normal ` –  Mar 20 '17 at 04:01
  • yes alright atleast i can use it for years dropdownlist :) – Samra Mar 20 '17 at 04:01

1 Answers1

0

I am using bootstrap-multiselect custom control though still wondering if it has the ability to add detail/adjacent column in it

Samra
  • 1,815
  • 4
  • 35
  • 71