{"id":1030,"date":"2020-04-24T15:40:05","date_gmt":"2020-04-24T14:40:05","guid":{"rendered":"https:\/\/ibex.tech\/windows-iot\/?p=1030"},"modified":"2020-04-24T15:40:05","modified_gmt":"2020-04-24T14:40:05","slug":"adding-a-datagrid","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/uwp-programming-in-c\/datagrid\/adding-a-datagrid","title":{"rendered":"Adding A DataGrid"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Resources<\/h4>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/communitytoolkit\/controls\/datagrid_guidance\/datagrid_basics\">https:\/\/docs.microsoft.com\/en-us\/windows\/communitytoolkit\/controls\/datagrid_guidance\/datagrid_basics<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Set the project up to support the DataGrid control<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Add the package<\/h5>\n\n\n\n<p>In Solution Explorer panel, right click on your project name and select Manage NuGet Packages. Search for &#8220;Microsoft.Toolkit.UWP.UI.Controls.DataGrid&#8221;.<\/p>\n\n\n\n<p>Install the Microsoft.Toolkit.Uwp.UI.Controls.DataGrid nuget package.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Add the reference to the top of your xaml page<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>xmlns:controls=\"using:Microsoft.Toolkit.Uwp.UI.Controls\"\nxmlns:prim=\"using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Add the DataGrid<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>      &lt;!-- DATA GRID --&gt;\n      &lt;controls:DataGrid Canvas.Left=\"10\" Canvas.Top=\"530\" Width=\"780\" Height=\"730\" x:Name=\"DataGrid1\"\n          AutoGenerateColumns=\"True\"\n                \n      \/&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Resources https:\/\/docs.microsoft.com\/en-us\/windows\/communitytoolkit\/controls\/datagrid_guidance\/datagrid_basics Set the project up to support the DataGrid control Add the package In Solution Explorer panel, right click on your project name and select Manage NuGet Packages. Search for &#8220;Microsoft.Toolkit.UWP.UI.Controls.DataGrid&#8221;. Install the Microsoft.Toolkit.Uwp.UI.Controls.DataGrid nuget package. Add the reference to the top of your xaml page Add the DataGrid<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[113],"tags":[],"class_list":["post-1030","post","type-post","status-publish","format-standard","hentry","category-datagrid"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/1030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=1030"}],"version-history":[{"count":0,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/1030\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=1030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=1030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=1030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}