<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Radu Enucă's Blog - All Comments</title><link>http://weblogs.asp.net/raduenuca/default.aspx</link><description>"By failing to prepare you are preparing to fail" - Benjamin Franklin</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#10263210</link><pubDate>Thu, 09 May 2013 10:00:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:10263210</guid><dc:creator>Tulika Shrivastava</dc:creator><description>&lt;p&gt;Thanks for this code. &lt;/p&gt;
&lt;p&gt;To have option and optgroup at the same level in one drop down box, the code can be edited as below -&lt;/p&gt;
&lt;p&gt;if (string.IsNullOrWhiteSpace(group.Key))&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;foreach (var item in group)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; listItemBuilder.AppendLine(ListItemToOption(item));&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;var groupName = groupedSelectListItems.Where(i =&amp;gt; i.GroupKey == group.Key).Select(it =&amp;gt; it.GroupName).FirstOrDefault();&lt;/p&gt;
&lt;p&gt; &amp;nbsp;listItemBuilder.AppendLine(string.Format(&amp;quot;&amp;lt;optgroup label=\&amp;quot;{0}\&amp;quot; value=\&amp;quot;{1}\&amp;quot;&amp;gt;&amp;quot;, groupName, group.Key));&lt;/p&gt;
&lt;p&gt; &amp;nbsp;foreach (var item in group)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;listItemBuilder.AppendLine(ListItemToOption(item));&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;listItemBuilder.AppendLine(&amp;quot;&amp;lt;/optgroup&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=10263210" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC–Displaying a tree view using a recursive declarative helper and jQuery</title><link>http://weblogs.asp.net/raduenuca/archive/2011/04/24/asp-net-mvc-displaying-a-tree-view-using-a-recursive-declarative-helper-and-jquery.aspx#10243461</link><pubDate>Fri, 03 May 2013 10:16:22 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:10243461</guid><dc:creator>robinspaul</dc:creator><description>&lt;p&gt;I am using HierarchyID in &amp;nbsp;SQL2008. Will this example work for it? Hope I have to use Stored Prcedure to populate all parents and children in the hierarchy. I have 6 levels in the hierarchy.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=10243461" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#9715817</link><pubDate>Tue, 08 Jan 2013 08:26:21 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:9715817</guid><dc:creator>Mark</dc:creator><description>&lt;p&gt;Does it support MVC4?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9715817" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#9466730</link><pubDate>Mon, 26 Nov 2012 18:46:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:9466730</guid><dc:creator>Joe</dc:creator><description>&lt;p&gt;Is `IDictionary&amp;lt;string , IEnumerable&amp;lt;SelectListItem&amp;gt;&amp;gt;` the right type for this? &amp;nbsp;IDictionary&amp;lt;TKey, TValue&amp;gt; doesn&amp;#39;t guarantee the order, and in most cases the caller will want to control the order in which the groups are rendered.&lt;/p&gt;
&lt;p&gt;Maybe should pass the data in another way, e.g. as an IEnumerable&amp;lt;Tuple&amp;lt;string, IEnumerable&amp;lt;SelectListItem&amp;gt;&amp;gt; or for .NET 3.x IEnumerable&amp;lt;KeyValuePair&amp;lt;string, IEnumerable&amp;lt;SelectListItem&amp;gt;&amp;gt;.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9466730" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC–Cascading Dropdown Lists Tutorial–Part 5.2: Cascading using jQuery.ajax() ($.ajax() and jQuery Templates)</title><link>http://weblogs.asp.net/raduenuca/archive/2011/04/10/asp-net-mvc-cascading-dropdown-lists-tutorial-part-5-2-cascading-using-jquery-ajax-ajax-and-jquery-templates.aspx#8913166</link><pubDate>Wed, 12 Sep 2012 12:00:34 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8913166</guid><dc:creator>Karin</dc:creator><description>&lt;p&gt;You might want to remove this option, as jquery no longer supports the templating plugin&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8913166" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC–Displaying a tree view using a recursive declarative helper and jQuery</title><link>http://weblogs.asp.net/raduenuca/archive/2011/04/24/asp-net-mvc-displaying-a-tree-view-using-a-recursive-declarative-helper-and-jquery.aspx#8908617</link><pubDate>Tue, 11 Sep 2012 05:56:02 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8908617</guid><dc:creator>Madhura</dc:creator><description>&lt;p&gt;Very useful information.. :)&lt;/p&gt;
&lt;p&gt;Thanks..:)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8908617" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#8882082</link><pubDate>Fri, 31 Aug 2012 18:16:15 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8882082</guid><dc:creator>Cleost</dc:creator><description>&lt;p&gt;Hi, nice done. Does this sample support data annotation validation? How can I use something like this &lt;a rel="nofollow" target="_new" href="http://www.dotnetexpertguide.com/2012/06/cascading-dropdown-knockoutjs-aspnet.html"&gt;www.dotnetexpertguide.com/.../cascading-dropdown-knockoutjs-aspnet.html&lt;/a&gt; when I select first continent and only then city with groupping by country? Can you help me with it? And what will be if we modify our model like this &amp;nbsp;&lt;/p&gt;
&lt;p&gt;public class City&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public int CityId { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public string Name { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public int? CountryId { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;I need to try it in my MVC4 solution, but how should I correctly use your sample? Thank you!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8882082" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#8880040</link><pubDate>Thu, 30 Aug 2012 17:54:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8880040</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Good done! But does it support data annotation validation? And how can I use this solution in my MVC 4 application? Please, help me and sorry for my bad english.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8880040" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC–Displaying a tree view using a recursive declarative helper and jQuery</title><link>http://weblogs.asp.net/raduenuca/archive/2011/04/24/asp-net-mvc-displaying-a-tree-view-using-a-recursive-declarative-helper-and-jquery.aspx#8825552</link><pubDate>Wed, 08 Aug 2012 17:03:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8825552</guid><dc:creator>Szymon</dc:creator><description>&lt;p&gt;hi &lt;/p&gt;
&lt;p&gt;I want to made the same treeview as you at following link &amp;quot;&lt;a rel="nofollow" target="_new" href="http://demos.raduenuca.ro/MVC3Extensions/Various/TreeView&amp;quot;"&gt;demos.raduenuca.ro/.../TreeView&amp;quot;&lt;/a&gt; can you send me source code of this ?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8825552" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC – Extending the DropDownList to show the items grouped by a category</title><link>http://weblogs.asp.net/raduenuca/archive/2011/02/26/asp-net-mvc-extending-the-dropdownlist-to-show-the-items-grouped-by-a-category.aspx#8727365</link><pubDate>Thu, 12 Jul 2012 09:01:27 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8727365</guid><dc:creator>khumesh</dc:creator><description>&lt;p&gt;Cool!! Its very nice solution for &amp;quot;DropDownList to show the items grouped by a category&amp;quot; in MVC3, I have used this one, its working fine. Thanks!!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8727365" width="1" height="1"&gt;</description></item></channel></rss>