How to show/hide column in GridView<p>Hi everybody,</p> <p>Please help me show/hide column in GridView of Avalon. Datagridview of window form 2.0 has visible property in order to show/hide columns. </p> <p>Every body solved my issue, please let me knows.</p> <p>Thanks.</p> <p>Steven</p>© 2009 Microsoft Corporation. All rights reserved.Fri, 20 Nov 2009 05:23:25 Z30b7ed89-2ae1-451f-922a-b82078129a0chttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#30b7ed89-2ae1-451f-922a-b82078129a0chttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#30b7ed89-2ae1-451f-922a-b82078129a0cSteven Khiemhttp://social.msdn.microsoft.com/Profile/en-US/?user=Steven%20KhiemHow to show/hide column in GridView<p>Hi everybody,</p> <p>Please help me show/hide column in GridView of Avalon. Datagridview of window form 2.0 has visible property in order to show/hide columns. </p> <p>Every body solved my issue, please let me knows.</p> <p>Thanks.</p> <p>Steven</p>Wed, 01 Mar 2006 09:23:52 Z2006-12-15T19:05:14Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#2a8fd6b7-711d-4833-819f-460c393b314fhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#2a8fd6b7-711d-4833-819f-460c393b314fMichaelLattahttp://social.msdn.microsoft.com/Profile/en-US/?user=MichaelLattaHow to show/hide column in GridViewTo hide a column just set the width to 0.  To show it again set the width to auto.Wed, 01 Mar 2006 16:08:19 Z2006-03-01T22:36:07Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#91bfc34c-64d6-4ec0-971c-bdb4fe19e558http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#91bfc34c-64d6-4ec0-971c-bdb4fe19e558Steven Khiemhttp://social.msdn.microsoft.com/Profile/en-US/?user=Steven%20KhiemHow to show/hide column in GridView<p>Hi Michael</p> <p>I set width property = 0.However, I still resize this column when I move mouse on header column.</p> <p>Do you have another solution ?</p> <p>Thanks</p> <p>Steven</p>Thu, 02 Mar 2006 02:16:37 Z2006-03-02T02:16:37Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#d2a1928d-3877-48e9-8bca-b13f29d8b434http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#d2a1928d-3877-48e9-8bca-b13f29d8b434zhilihttp://social.msdn.microsoft.com/Profile/en-US/?user=zhiliHow to show/hide column in GridViewHow about using add/remove column since GridView is just a &quot;view&quot; of tabular data. Is that ok for your scenario?Fri, 03 Mar 2006 06:41:50 Z2006-03-03T06:41:50Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#b2c7841a-e4c2-4f23-9234-5788e93812d8http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#b2c7841a-e4c2-4f23-9234-5788e93812d8Steven Khiemhttp://social.msdn.microsoft.com/Profile/en-US/?user=Steven%20KhiemHow to show/hide column in GridView<p>Sorry, that is not my scenario, You can take a look DataGridView of Window Form 2.0. when I set DataGridViewColumn.Visible = False, this column is hided, and then DataGridViewColumn.Visible = True this column is showed again.</p> <p>So far, is my scenario is clear ?</p> <p>Thanks for your help, I'm looking forward to hearing from you.</p> <p>Steven</p>Thu, 09 Mar 2006 01:56:35 Z2006-03-09T01:56:35Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#6a462e5d-a918-4c09-acc6-cca66f23bfd8http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#6a462e5d-a918-4c09-acc6-cca66f23bfd8zhilihttp://social.msdn.microsoft.com/Profile/en-US/?user=zhiliHow to show/hide column in GridView<p>Currently GridView doesn't provide such a property for column. My point is, in most cases, you can use Add/Insert/Remove method in GridViewColumnCollection to have the same effect of show/hide. </p>Thu, 09 Mar 2006 02:48:06 Z2006-03-09T02:48:06Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#e502337e-06a3-4066-bae7-058d87fef8d5http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#e502337e-06a3-4066-bae7-058d87fef8d5James_Linhttp://social.msdn.microsoft.com/Profile/en-US/?user=James_LinHow to show/hide column in GridViewuse this<br>GridView1.Columns[0].Visible = false;<br>Wed, 22 Mar 2006 21:48:41 Z2006-03-22T21:48:41Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#47b18966-7839-4433-8d65-5d749ee8cf39http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#47b18966-7839-4433-8d65-5d749ee8cf39Ahmed_khemirihttp://social.msdn.microsoft.com/Profile/en-US/?user=Ahmed_khemiriHow to show/hide column in GridViewthe problem that i use an object data source that's why i must use autogeneratecolumn.<br>and when i use it i can't use gridview.colomns[0] because the gridview don't see the colomn because of autogeneratecolumn. please help  me <br>thank you.<br>Wed, 29 Mar 2006 20:03:16 Z2006-03-29T20:03:16Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#0bb60894-72ae-4af0-9da4-0ed2f2352781http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#0bb60894-72ae-4af0-9da4-0ed2f2352781WPFMonkeyhttp://social.msdn.microsoft.com/Profile/en-US/?user=WPFMonkeyHow to show/hide column in GridView<p>Using the latest CTP trying to set the visibility of a column gives the following compilation error:</p> <p>Error 10 'System.Windows.Controls.GridViewColumn' does not contain a definition for 'Visible'</p> <p>So is changing the width the only way to accomplish this?  I'm imagining allowing the user to show/hide columns in a GridView to suit their needs.</p>Wed, 26 Apr 2006 21:48:22 Z2006-04-26T21:48:22Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#f242599c-d5e0-4653-be15-06bc082c9955http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#f242599c-d5e0-4653-be15-06bc082c9955rupesh_Sidparahttp://social.msdn.microsoft.com/Profile/en-US/?user=rupesh_SidparaHow to show/hide column in GridViewhiSat, 29 Jul 2006 09:09:48 Z2006-07-29T09:09:48Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#c73a534a-123f-4862-893f-300cd8f820b6http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#c73a534a-123f-4862-893f-300cd8f820b6Thomas LEBRUNhttp://social.msdn.microsoft.com/Profile/en-US/?user=Thomas%20LEBRUNHow to show/hide column in GridView<p>Acording to the GridViewColumn properties (<a title="http://windowssdk.msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumn_properties.aspx" href="http://windowssdk.msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumn_properties.aspx">http://windowssdk.msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumn_properties.aspx</a>), it looks like to be the best way to accomplish this.</p> <p> </p> <p>Maybe you can try to change the ColumnTemplate: I can't test now but maube it will work :)</p> <p> </p> <p>Bye</p>Sat, 29 Jul 2006 14:45:52 Z2006-07-29T14:45:52Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#a7edfeea-bba5-4cf4-9bdf-93d09fae16d4http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#a7edfeea-bba5-4cf4-9bdf-93d09fae16d4Brownie Pointshttp://social.msdn.microsoft.com/Profile/en-US/?user=Brownie%20PointsHow to show/hide column in GridView<p>Column visibility...it's an easy enough task to do. I'll make sure that goes into the spec for the WPFToolbelt Grid. Although the GridView is pretty good...it doesn't have a lot of the convenience methods that the DataGridView in Winforms 2.0</p> <p><font face=Verdana>See my <a title="http://mbrownchicago.spaces.msn.com/blog/cns!2221DC39E0C749A4!153.entry" href="http://mbrownchicago.spaces.msn.com/blog/cns!2221DC39E0C749A4!153.entry">blog entry</a> to see the functionality that has been implemented or planned for the first release of the SmartDataGrid.</font></p>Sat, 29 Jul 2006 15:29:42 Z2006-07-29T15:29:42Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#da61d91d-f691-4c06-b0e1-80645f60525fhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#da61d91d-f691-4c06-b0e1-80645f60525fasadnaeemhttp://social.msdn.microsoft.com/Profile/en-US/?user=asadnaeemHow to show/hide column in GridView<p>Here i found the solution</p> <p><a title="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Hidden-Column.aspx" href="http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Hidden-Column.aspx">http://www.beansoftware.com/ASP.NET-Tutorials/GridView-Hidden-Column.aspx</a></p> <p>Thanks and Best of Luck</p> <p>Asad Naeem</p>Fri, 15 Dec 2006 13:25:32 Z2006-12-15T13:25:32Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#9a3f6ccb-171a-4551-a103-106098a50578http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#9a3f6ccb-171a-4551-a103-106098a50578Brownie Pointshttp://social.msdn.microsoft.com/Profile/en-US/?user=Brownie%20PointsHow to show/hide column in GridViewThat's for ASP Gridviews. However, it's good that we could revisit this matter. I think that setting Visibility to collapsed should do what the original poster wants.Fri, 15 Dec 2006 19:05:03 Z2006-12-15T19:05:14Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#221befd3-7138-40ff-a73f-32e89cec89a3http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#221befd3-7138-40ff-a73f-32e89cec89a3Nilesh Makwanahttp://social.msdn.microsoft.com/Profile/en-US/?user=Nilesh%20MakwanaHow to show/hide column in GridView Hello Steven,<br><br><em><strong>this is for somebody who still has the same problem and needs a solution:</strong></em><br><br>I had the same problem and  I solved it.<br><br>Can u just name the Gridview using its x:Name property, like <font color="#ff0000" size=2> <p><font color="#0000ff" size=2></p> <p>&lt;</font><font color="#a31515" size=2>GridView</font><font size=2> </font>x</font><font color="#0000ff" size=2>:</font><font color="#ff0000" size=2>Name</font><font color="#0000ff" size=2>=&quot;gvCustomer&quot; &gt;<br><br>and then in programming use this :<br><br><font size=2></p> <p>gvCustomer.Columns.RemoveAt(0); </p></font><br>to hide the first column.<br><br>alternatively you can also use gvCustomer.Columns.Remove to remove a specific gridviewColumn.<br><br>Nilesh</font>Wed, 20 Aug 2008 07:07:23 Z2008-08-20T07:08:49Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#00c107b5-0097-4faa-8efb-3f93de5bed77http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#00c107b5-0097-4faa-8efb-3f93de5bed77SoftProgrammerrhttp://social.msdn.microsoft.com/Profile/en-US/?user=SoftProgrammerrHow to show/hide column in GridViewHello all,<br/><br/>I am having a similar kind of problem and I have not been able to get any solutions so far.<br/><br/>I have 5 columns in my gridview and I want to hid one of them and show the one hidden in the textbox!<br/>I have been able to hid the column but when I hid it I can't retive the data from gridview!<br/>please help me out.<br/><br/><br/>Thanks to alll in advanceWed, 12 Aug 2009 15:51:10 Z2009-08-12T15:51:10Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#b5df6396-2702-4dcc-ac0f-35cf2cbc2779http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/30b7ed89-2ae1-451f-922a-b82078129a0c#b5df6396-2702-4dcc-ac0f-35cf2cbc2779ilasuperhttp://social.msdn.microsoft.com/Profile/en-US/?user=ilasuperHow to show/hide column in GridViewHello all, <div><br/></div> <div>Use datatable as an datasource.. and before binding to gridview remove column from datatable... tahn bind it in gridview....</div> <div><br/></div> <div>:)</div> <div><br/></div> <div>Happy coding...</div>Sun, 13 Sep 2009 17:27:27 Z2009-09-13T17:27:27Z