|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to hide one column in datagrid?Hi~
I want to know if I want to hide a column in datagrid because I don't want to show that column of data. How can I do this? Sidney Well, I think it depends on what is the DataSource for your Datagrid. If you
are loading data from a DataSet or DataTable, you might prefer not to load that particular column at all, into your DataSet. Additionally, to create a customized view of a table, create a collection of DataGridColumnStyle objects, and set each column's MappingName to the ColumnName of a column that you want to show in the grid. To hide a column, set its MappingName to something other than a valid ColumnName. Hope this helps, Regards, Cerebrus. Create a DataGridTableStyle, set its MappingName to the name of your
table, create DataGridColumnStyle objects for each of your column, setting the MappingName equal to the ColumnName and add them to the DataGridTableStyle. Add the table style to the DataGrid's TableStyles collection. Then you can hide the desired column by setting the Width property of DataGridColumnStyle object of the specific column equal to 0 Regards GM Sidney,
Another method, be aware that it hides than the column everywhere. http://www.vb-tips.com/default.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd I hope this helps, Cor
master volume control in winmm using namespaces
Cdbl & International Settings can you add onMouseOver/onMouseOut to an ImageButton?? Eschewing the Form Designer VB.NET (2005); Sqlce ? How to get worksheet names from an excel file? VB.Net code to upsize Access DB to SQL Express? Hex with leading zeros to string? Dynamically remove child controls ? Step by step it works but... |
|||||||||||||||||||||||