{"id":101,"date":"2015-10-18T09:45:50","date_gmt":"2015-10-18T09:45:50","guid":{"rendered":"http:\/\/vladymix.es\/?p=101"},"modified":"2015-10-18T09:58:27","modified_gmt":"2015-10-18T09:58:27","slug":"gridview-horizontal-o-vertical","status":"publish","type":"post","link":"https:\/\/vladymix.es\/wordpress\/index.php\/2015\/10\/18\/gridview-horizontal-o-vertical\/","title":{"rendered":"GridView &#8211; [Horizontal o  Vertical]"},"content":{"rendered":"<pre class=\"lang:default decode:true \">&lt;GridView \/&gt;<\/pre>\n<p>El nuevo GridView \u00a0 de windows 10 universal app tiene por defecto una distribuci\u00f3n de los items horizontal.<\/p>\n<p>Aqu\u00ed les dejo un par de lineas de c\u00f3digo para poner la distribuci\u00f3n en horizontal o vertical<\/p>\n<ul>\n<li>\n<h4>GridView Items Vertical.<\/h4>\n<\/li>\n<\/ul>\n<pre class=\"lang:xhtml decode:true\" title=\"xaml GridView\"> &lt;GridView IsSwipeEnabled=\"False\" SelectionMode=\"Single\"  \r\n           ItemTemplate=\"{StaticResource ItemBusLine}\"\r\n           ItemsSource=\"{Binding ListOfBusLine}\"&gt;\r\n      &lt;GridView.ItemsPanel&gt;\r\n           &lt;ItemsPanelTemplate&gt;\r\n               &lt;WrapGrid Orientation=\"Vertical\" \/&gt;\r\n            &lt;\/ItemsPanelTemplate&gt;\r\n      &lt;\/GridView.ItemsPanel&gt;\r\n &lt;\/GridView&gt;<\/pre>\n<p>Ahora tenemos peque\u00f1o problema, no se puede hacer el scroll, vamos a solucionarlo con un par de atributos de GridView<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;GridView IsSwipeEnabled=\"False\" SelectionMode=\"Single\"  \r\n          ScrollViewer.HorizontalScrollMode=\"Auto\" \r\n          ScrollViewer.VerticalScrollMode=\"Disabled\"\r\n           ItemTemplate=\"{StaticResource ItemBusLine}\"\r\n           ItemsSource=\"{Binding ListOfBusLine}\"&gt;\r\n      &lt;GridView.ItemsPanel&gt;\r\n           &lt;ItemsPanelTemplate&gt;\r\n               &lt;WrapGrid Orientation=\"Vertical\" \/&gt;\r\n            &lt;\/ItemsPanelTemplate&gt;\r\n      &lt;\/GridView.ItemsPanel&gt;\r\n &lt;\/GridView&gt;<\/pre>\n<ul>\n<li>\n<h4>GridView Items Horizontal.<\/h4>\n<\/li>\n<\/ul>\n<pre class=\"lang:xhtml decode:true\"> &lt;GridView IsSwipeEnabled=\"False\" SelectionMode=\"Single\"  \r\n           ScrollViewer.HorizontalScrollMode=\"Disabled\" \r\n          ScrollViewer.VerticalScrollMode=\"Auto\"\r\n           ItemTemplate=\"{StaticResource ItemBusLine}\"\r\n           ItemsSource=\"{Binding ListOfBusLine}\"&gt;\r\n      &lt;GridView.ItemsPanel&gt;\r\n           &lt;ItemsPanelTemplate&gt;\r\n               &lt;WrapGrid Orientation=\"Horizontal\" \/&gt;\r\n            &lt;\/ItemsPanelTemplate&gt;\r\n      &lt;\/GridView.ItemsPanel&gt;\r\n &lt;\/GridView&gt;<\/pre>\n<ul>\n<li>WrapGrid<\/li>\n<\/ul>\n<p>El atributo WrapGrid puede ayudarnos a definir tambi\u00e9n el n\u00famero m\u00e1ximo de items por filas o columnas (depender\u00e1 siempre del tama\u00f1o del GridView).<\/p>\n<pre class=\"lang:xhtml decode:true\">&lt;WrapGrid MaximumRowsOrColumns=\"10\" Orientation=\"Horizontal\" \/&gt;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;GridView \/&gt; El nuevo GridView \u00a0 de windows 10 universal app tiene por defecto una distribuci\u00f3n de los items horizontal.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-101","post","type-post","status-publish","format-standard","hentry","category-windows-store-and-phone","category-xaml"],"_links":{"self":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":14,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":116,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/101\/revisions\/116"}],"wp:attachment":[{"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vladymix.es\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}