{"id":705,"date":"2017-06-20T05:00:00","date_gmt":"2017-06-20T05:00:00","guid":{"rendered":"https:\/\/staging.infragistics.com\/blogs\/?p=705"},"modified":"2025-02-26T11:59:03","modified_gmt":"2025-02-26T11:59:03","slug":"xamarin-forms-grid","status":"publish","type":"post","link":"https:\/\/www.infragistics.com\/blogs\/xamarin-forms-grid","title":{"rendered":"Generate Your Next Xamarin.Forms Grid: It&#39;s as Easy as Drag and Drop"},"content":{"rendered":"\n<p>If you\u2019ve used other development platforms, you\u2019re probably used to using a native toolbox that lets you drag and drop controls or whatever you need to your code. Now you\u2019ve decided to use Xamarin.Forms\u2026 and there\u2019s no toolbox.<\/p>\n\n\n\n<p>That\u2019s where the <a href=\"\/products\/xamarin\" target=\"_blank\" rel=\"noopener noreferrer\">Ultimate UI Controls for Xamarin<\/a> comes in, and gives you the Infragistics Toolbox: the world\u2019s first NuGet powered toolbox for Xamarin.Forms. With this toolbox, you can drag and drop the component or control that you want to use, and the XAML code will be generated for you automatically.<\/p>\n\n\n\n<p>To gets started, we\u2019ll open up the app that we created. Once we have the solution open, right-click the project and select <b>Manage NuGet Packages for Solution<\/b>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"333\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image.png\" alt=\"right-click the project and select Manage NuGet Packages for Solution\" class=\"wp-image-2308\" title=\"right-click the project and select Manage NuGet Packages for Solution\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image.png 600w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-300x167.png 300w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-480x266.png 480w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>On the <em>Browse<\/em> tab of the NuGet package manager, search for <b>XF.DataGrid<\/b>. Select the <i>Infragistics.XF.DataGrid<\/i> package, and then enable the package for the project by marking the checkmarks. Click <b>Install<\/b> to add the package to the solution.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/community\/cfs-file.ashx\/__key\/CommunityServer.Blogs.Components.WeblogFiles\/infragistics.06-20-17-xam\/0045.2.PNG\" alt=\" enable the package for the project by marking the checkmarks. Click Install to add the package to the solution\" title=\"enable the package for the project by marking the checkmarks. Click Install to add the package to the solution\"\/><\/figure>\n\n\n\n<p>Now that we\u2019ve added the package, let\u2019s open the toolbox and see what we have. You can open the toolbox by clicking <b>View -&gt; Other Windows -&gt; Infragistics Toolbox<\/b>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"859\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-1.png\" alt=\"View -&gt; Other Windows -&gt; Infragistics Toolbox\" class=\"wp-image-2309\" title=\"View -&gt; Other Windows -&gt; Infragistics Toolbox\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-1.png 600w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-1-210x300.png 210w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-1-480x687.png 480w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>With the packages that we have installed, we should be able to see different layouts, views, and cells in the toolbox. For now, we\u2019ll focus specifically on using a grid.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"307\" height=\"353\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-2.png\" alt=\" For now, we\u2019ll focus specifically on using a grid\" class=\"wp-image-2310\" title=\" For now, we\u2019ll focus specifically on using a grid\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-2.png 307w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-2-261x300.png 261w\" sizes=\"auto, (max-width: 307px) 100vw, 307px\" \/><\/figure>\n\n\n\n<p>Using the solution that we created in a previous blog, we already have a View named <em>GridPage.xaml<\/em>. Let\u2019s open this page so that we can work with the toolbox. With the page open, place the cursor on a line and then double-click <b>Grid<\/b> from the toolbox.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"386\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-3.png\" alt=\"With the page open, place the cursor on a line and then double-click Grid from the toolbox\" class=\"wp-image-2311\" title=\"With the page open, place the cursor on a line and then double-click Grid from the toolbox\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-3.png 600w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-3-300x193.png 300w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-3-480x309.png 480w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>A blank grid will automatically get created for us. At this point, the grid isn\u2019t very interesting. We would still need to customize it based on how we want it to look, and how the data is supposed to appear. Let\u2019s delete this grid, and then add it a different way. With the cursor on a line, hold the <b>Ctrl<\/b> key and then double-click the <b>Grid<\/b> layout.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"593\" src=\"https:\/\/staging.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-4.png\" alt=\"With the cursor on a line, hold the Ctrl key and then double-click the Grid layout\" class=\"wp-image-2313\" title=\"With the cursor on a line, hold the Ctrl key and then double-click the Grid layout\" srcset=\"https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-4.png 600w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-4-300x297.png 300w, https:\/\/www.infragistics.com\/blogs\/wp-content\/uploads\/2017\/06\/image-4-480x474.png 480w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>Now we\u2019re talking about some real time savings. Not only is the grid created, but the layout of the grid is more complex by offering two columns and five rows for us automatically. You use this shortcut for grids and all of the other controls in the toolbox.<\/p>\n\n\n\n<p>Get started using the Toolbox to build mobile apps with this <a href=\"https:\/\/www.youtube.com\/watch?v=4L3S26U0HeM\" rel=\"noopener\">introduction video<\/a>, which walks you through the views, layouts, and tooltips that you can drag and drop to quickly design pages and automate your coding and formatting.<\/p>\n\n\n\n<iframe width=\"100%\" height=\"435\" src=\"https:\/\/www.youtube.com\/embed\/4L3S26U0HeM?si=vOxy7gCzdsLZLtY9\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n\n\n\n<p>Ready to see how you can save time creating layouts and views with the Infragistics Toolbox? <a href=\"\/products\/ultimate\/download?p=xamarin\" target=\"_blank\" rel=\"noopener noreferrer\">Download a trial<\/a> of the UI Controls for Xamarin to get started. We also have <a href=\"\/products\/xamarin\/write-fast\" target=\"_blank\" rel=\"noopener noreferrer\">videos and lessons<\/a> to help you out.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve used other development platforms, you\u2019re probably used to using a native toolbox that lets you drag and drop controls or whatever you need to your code. Now you\u2019ve decided to use Xamarin.Forms\u2026 and there\u2019s no toolbox.<\/p>\n","protected":false},"author":165,"featured_media":2367,"comment_status":"publish","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to"],"_links":{"self":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/users\/165"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/comments?post=705"}],"version-history":[{"count":3,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/705\/revisions"}],"predecessor-version":[{"id":2504,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/posts\/705\/revisions\/2504"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/media\/2367"}],"wp:attachment":[{"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/media?parent=705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/categories?post=705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infragistics.com\/blogs\/wp-json\/wp\/v2\/tags?post=705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}