{"id":22,"date":"2015-04-13T19:54:08","date_gmt":"2015-04-13T16:54:08","guid":{"rendered":"http:\/\/www.cuneytbayrak.com\/?p=22"},"modified":"2025-02-21T00:51:51","modified_gmt":"2025-02-20T21:51:51","slug":"c-datagrid-columns-visible-or-hidden","status":"publish","type":"post","link":"http:\/\/www.cuneytbayrak.com\/?p=22","title":{"rendered":"C# DataGrid Columns visible or hidden"},"content":{"rendered":"<p>Merhabalar. Projelerimizde kulland\u0131\u011f\u0131m\u0131z datagridlerin kolonlar\u0131n\u0131 gizleyip tekrar a\u00e7mak isteyebiliriz. Bu durumda a\u015fa\u011f\u0131da ki gibi bir kod kullanmak i\u015finize yarayabilir.\u00a0<strong>\u201cdg1\u201d<\/strong>\u00a0formumuzda kulland\u0131\u011f\u0131m\u0131z datagrid\u2019in name\u2019i dir. Buna dikkat edin.<\/p>\n<div class=\"wp-block-codemirror-blocks code-block \">\n<pre class=\"CodeMirror\" data-setting=\"{&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csharp&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;lineWrapping&quot;:false,&quot;styleActiveLine&quot;:false,&quot;readOnly&quot;:true,&quot;align&quot;:&quot;&quot;}\">void btn_Click(object sender, RoutedEventArgs e)\r\n{\r\n     foreach (DataGridColumn col in dg1.Columns)\r\n     {\r\n        if (col.Visibility==Visibility.Hidden)\r\n        {\r\n           col.Visibility = Visibility.Visible;\r\n        }\r\n        else\r\n        {\r\n           col.Visibility = Visibility.Hidden;\r\n        }\r\n     }\r\n}<\/pre>\n<\/div>\n<p>Kolay gele&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhabalar. Projelerimizde kulland\u0131\u011f\u0131m\u0131z datagridlerin kolonlar\u0131n\u0131 gizleyip tekrar a\u00e7mak isteyebiliriz. Bu durumda a\u015fa\u011f\u0131da ki gibi bir kod kullanmak i\u015finize yarayabilir.\u00a0\u201cdg1\u201d\u00a0formumuzda kulland\u0131\u011f\u0131m\u0131z datagrid\u2019in name\u2019i dir. Buna dikkat edin. void btn_Click(object sender, RoutedEventArgs&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"http:\/\/www.cuneytbayrak.com\/?p=22\">Devam\u0131n\u0131 Oku<span class=\"screen-reader-text\">C# DataGrid Columns visible or hidden<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-22","post","type-post","status-publish","format-standard","hentry","category-c","excerpt"],"_links":{"self":[{"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/posts\/22","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22"}],"version-history":[{"count":1,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions"}],"predecessor-version":[{"id":23,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=\/wp\/v2\/posts\/22\/revisions\/23"}],"wp:attachment":[{"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cuneytbayrak.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}