<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rendering and Binding Drop Down Lists using ASP.NET MVC 2 EditorFor</title>
	<atom:link href="http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/</link>
	<description>Making stuff up about web development since last week.</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:29:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: David J Ledgett</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-42358</link>
		<dc:creator>David J Ledgett</dc:creator>
		<pubDate>Wed, 04 Jan 2012 11:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-42358</guid>
		<description>Hi Nick,

Once again thanks for your help over the last few days. Much appreciated 

Regards

Dave</description>
		<content:encoded><![CDATA[<p>Hi Nick,</p>
<p>Once again thanks for your help over the last few days. Much appreciated </p>
<p>Regards</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David J Ledgett</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-42053</link>
		<dc:creator>David J Ledgett</dc:creator>
		<pubDate>Mon, 02 Jan 2012 13:59:51 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-42053</guid>
		<description>Dear Nick,

Thanks very much for your most interesting article. This is very much appreciated although I must say that I am experiencing problems which in all likely hood is just a function of my stupidity.

If I were to zip up my project would you be as so kind as to have a quick look if and when you have the time. I am a relative &quot;newbie&quot; to MVC so you will be helping me to keep what little hair I have on my head intact.

Once again thank you for your time and for this post as I would certainly love to include this as part of my project

Yours Sincerely

David J Ledgett 

On</description>
		<content:encoded><![CDATA[<p>Dear Nick,</p>
<p>Thanks very much for your most interesting article. This is very much appreciated although I must say that I am experiencing problems which in all likely hood is just a function of my stupidity.</p>
<p>If I were to zip up my project would you be as so kind as to have a quick look if and when you have the time. I am a relative &#8220;newbie&#8221; to MVC so you will be helping me to keep what little hair I have on my head intact.</p>
<p>Once again thank you for your time and for this post as I would certainly love to include this as part of my project</p>
<p>Yours Sincerely</p>
<p>David J Ledgett </p>
<p>On</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robby Gomillion</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-39863</link>
		<dc:creator>Robby Gomillion</dc:creator>
		<pubDate>Wed, 14 Dec 2011 09:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-39863</guid>
		<description>You could definitely see your skills in the work you write. The arena hopes for more passionate writers like you who are not afraid to mention how they believe. At all times go after your heart. &quot;Experience is a good school, but the fees are high.&quot; by Heinrich Heine.</description>
		<content:encoded><![CDATA[<p>You could definitely see your skills in the work you write. The arena hopes for more passionate writers like you who are not afraid to mention how they believe. At all times go after your heart. &#8220;Experience is a good school, but the fees are high.&#8221; by Heinrich Heine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gillou</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-35990</link>
		<dc:creator>Gillou</dc:creator>
		<pubDate>Sun, 06 Nov 2011 22:10:02 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-35990</guid>
		<description>test</description>
		<content:encoded><![CDATA[<p>test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-24277</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Wed, 24 Aug 2011 06:00:42 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-24277</guid>
		<description>I considered using EditorFor.. but it&#039;s just simpler to use DropDownListFor, and this allows for tweaking at runtime and doesn&#039;t require recompilation.

See example (where Model.ProductGroups is simply IEnumerable):

&lt;code&gt;
@Html.DropDownListFor(model =&gt; model.Product.ProductGroup.Id, new SelectList(Model.ProductGroups, &quot;Id&quot;, &quot;Name&quot;), &quot;-- Select --&quot;)
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I considered using EditorFor.. but it&#8217;s just simpler to use DropDownListFor, and this allows for tweaking at runtime and doesn&#8217;t require recompilation.</p>
<p>See example (where Model.ProductGroups is simply IEnumerable):</p>
<p><code><br />
@Html.DropDownListFor(model =&gt; model.Product.ProductGroup.Id, new SelectList(Model.ProductGroups, "Id", "Name"), "-- Select --")<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel McColl</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-17763</link>
		<dc:creator>Joel McColl</dc:creator>
		<pubDate>Sat, 16 Jul 2011 00:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-17763</guid>
		<description>The items must have the SelectListItem collection which the browser will not post.  It will only include the value selected. It is quite all right because I just needed the selected item and not the whole collection.

I am not really interested in the selection list so what I did was to create a SelectionListItem with item selected.

IEnumerable items = new[] { new SelectListItem { Value = listItemValue, Text = &quot;&quot; , Selected = true } };

There you go.  The value is passed back to the controller with the same type as you passed it to the form.</description>
		<content:encoded><![CDATA[<p>The items must have the SelectListItem collection which the browser will not post.  It will only include the value selected. It is quite all right because I just needed the selected item and not the whole collection.</p>
<p>I am not really interested in the selection list so what I did was to create a SelectionListItem with item selected.</p>
<p>IEnumerable items = new[] { new SelectListItem { Value = listItemValue, Text = &#8220;&#8221; , Selected = true } };</p>
<p>There you go.  The value is passed back to the controller with the same type as you passed it to the form.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: diaconu13</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-11645</link>
		<dc:creator>diaconu13</dc:creator>
		<pubDate>Tue, 31 May 2011 10:38:48 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-11645</guid>
		<description>Unfortunately this is not working if i do the Movie assignment on the controller before passing the model to the view.
If i make something like :
 public ActionResult Index()
        {
            var bestPictureViewModel = new BestPictureViewModel();
            bestPictureViewModel.Movies = new[] {
                new SelectListItem() { Value = &quot;1&quot;, Text = &quot;Slumdog Millionaire&quot; },
                new SelectListItem() { Value = &quot;2&quot;, Text = &quot;The Curious Case of Benjamin Button&quot; },
                new SelectListItem() { Value = &quot;3&quot;, Text = &quot;Frost/Nixon&quot; },
                new SelectListItem() { Value = &quot;4&quot;, Text = &quot;Milk&quot; },
                new SelectListItem() { Value = &quot;5&quot;, Text = &quot;The Reader&quot; },
            };

            return View(bestPictureViewModel);
        }

Then I have items=null on line 22.
Do you have any Ideea how to fix this ?

Thank you.</description>
		<content:encoded><![CDATA[<p>Unfortunately this is not working if i do the Movie assignment on the controller before passing the model to the view.<br />
If i make something like :<br />
 public ActionResult Index()<br />
        {<br />
            var bestPictureViewModel = new BestPictureViewModel();<br />
            bestPictureViewModel.Movies = new[] {<br />
                new SelectListItem() { Value = &#8220;1&#8243;, Text = &#8220;Slumdog Millionaire&#8221; },<br />
                new SelectListItem() { Value = &#8220;2&#8243;, Text = &#8220;The Curious Case of Benjamin Button&#8221; },<br />
                new SelectListItem() { Value = &#8220;3&#8243;, Text = &#8220;Frost/Nixon&#8221; },<br />
                new SelectListItem() { Value = &#8220;4&#8243;, Text = &#8220;Milk&#8221; },<br />
                new SelectListItem() { Value = &#8220;5&#8243;, Text = &#8220;The Reader&#8221; },<br />
            };</p>
<p>            return View(bestPictureViewModel);<br />
        }</p>
<p>Then I have items=null on line 22.<br />
Do you have any Ideea how to fix this ?</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CopFace</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-7291</link>
		<dc:creator>CopFace</dc:creator>
		<pubDate>Fri, 29 Apr 2011 02:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-7291</guid>
		<description>I would like to know how to load data into the first combobox(Is covered by the above tutorial) and based on the data in first combobox, load some other data into a second combobox.</description>
		<content:encoded><![CDATA[<p>I would like to know how to load data into the first combobox(Is covered by the above tutorial) and based on the data in first combobox, load some other data into a second combobox.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrice</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-5795</link>
		<dc:creator>Patrice</dc:creator>
		<pubDate>Tue, 29 Mar 2011 14:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-5795</guid>
		<description>Well, this example is working fine if I do not use the Editfor to generate completly the form. In fact I try to understand why I can&#039;t use a list EditorTemplate when the model properties associate with this dropdown is included in a model not only dedicated to this dropdown. In others words My dropdown is include in a forms where I want using  Model.MyModel)%&gt; to generate this form and the Model&#039;s properties will have to be associate with a dropdown for one of them and normal textbox for the others</description>
		<content:encoded><![CDATA[<p>Well, this example is working fine if I do not use the Editfor to generate completly the form. In fact I try to understand why I can&#8217;t use a list EditorTemplate when the model properties associate with this dropdown is included in a model not only dedicated to this dropdown. In others words My dropdown is include in a forms where I want using  Model.MyModel)%&gt; to generate this form and the Model&#8217;s properties will have to be associate with a dropdown for one of them and normal textbox for the others</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Lundgren</title>
		<link>http://www.nickriggs.com/posts/rendering-and-binding-drop-down-lists-using-asp-net-mvc-2-editorfor/comment-page-1/#comment-5650</link>
		<dc:creator>Andrew Lundgren</dc:creator>
		<pubDate>Mon, 28 Mar 2011 09:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://nickriggs.com/?p=168#comment-5650</guid>
		<description>@Html.DropDownList

http://codeclimber.net.nz/archive/2009/08/10/how-to-create-a-dropdownlist-with-asp.net-mvc.aspx</description>
		<content:encoded><![CDATA[<p>@Html.DropDownList</p>
<p><a href="http://codeclimber.net.nz/archive/2009/08/10/how-to-create-a-dropdownlist-with-asp.net-mvc.aspx" rel="nofollow">http://codeclimber.net.nz/archive/2009/08/10/how-to-create-a-dropdownlist-with-asp.net-mvc.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

