1

MVC newbie here again!

I have two lists in my controller.

IList<Cars> allCars = _repository.GetAll<Cars>();
IList<Bikes> allBikes = _repository.GetAll<Bikes>();

Cars { Id, Name }
Bikes { Id, Name }

So, I have this list of class and I want to display a select dropdown list with an optgroup for bikes and cars, something like this: http://jsfiddle.net/xNEm9/

thanks!

LocustHorde
  • 6,065
  • 16
  • 58
  • 89
  • @Nicholas: I can't find anything in how to answer link, what am I supposed to be looking at? Thanks. – LocustHorde Aug 16 '11 at 14:49
  • my answer was auto changed to a comment. I'll remove the How to Answer link from that comment. Actually I can't edit it - I will the delete the comment. Basically I was pointing you to this question and answers http://stackoverflow.com/questions/607188/support-for-optgroup-in-dropdownlist-net-mvc – Nicholas Murray Aug 16 '11 at 14:53
  • @Nicholas, oh, okay, thanks. will look. – LocustHorde Aug 16 '11 at 17:32

1 Answers1

1

I don't think you can without additional code but I think somebody worked on it before: Support for optgroup in dropdownlist .NET MVC?

Community
  • 1
  • 1
Tae-Sung Shin
  • 19,749
  • 32
  • 136
  • 235