Hiding columns in a DataGridView

G

Greg

I know that I can programatically hide a column in a DataGridView but I'd
like to be able to specify in my DataView or DataTable that a column should
not be displayable. I tried using DataColumn.ColumnMapping and setting it
to MappingType.Hidden but that works only for some types. If i try to use
that for a GUID column type it throws an exception. Is there a good way to
specify that some columns in a DataSet should not be displayed without
having to explicitly hide the columns with the Grid?
 
K

Kevin Yu [MSFT]

Hi Greg,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to hide a column in
DatGridView in VS.NET 2005. If there is any misunderstanding, please feel
free to let me know.

Since VS.NET 2005 hasn't been officially released yet, I suggestion you try
to ask this in the VS.NET 2005 newsgroup from the following link:

http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slci
d=us

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
G

Greg

Actually its the same whether I use DataGrid or DataGrid view. I want to
specify hidden columns in a DataSet/DataTable. I know how to hide columns
in the control. But I don't want to do that. I want to specify that a
column is hidden from the DataSet end of things.
 
C

Cor Ligthert

Greg,

This sound so strange for me
Actually its the same whether I use DataGrid or DataGrid view. I want to
specify hidden columns in a DataSet/DataTable. I know how to hide columns
in the control. But I don't want to do that. I want to specify that a
column is hidden from the DataSet end of things.

The controls show data, the dataset holds data.

Therefore, I don't understand what a column in a dataset can be that is
hidden.

Do you mean you want to remove it completely, that is possible, however you
don't than not get it easy back.

I thought that I have seen here a solution where somebody creates an
intermediate dataset, and moves than the columns between those.

However, how do you than want to use that when the same data is used in more
places to display?

I am curious how you imagine just theoretical to do this.

Cor
 
K

Kevin Yu [MSFT]

Hi Greg,

Since VS.NET 2005 is a beta version, we cannot be sure that each feature in
the framework works perfectly. It is still being tested and repaired.

I have tried to set a GUID column's ColumnMapping property to
MappingType.Hidden in VS.NET 2003. It works fine on my computer. Are you
working on 2005 or 2003? If 2005, please try to ask in the newsgroup I gave
in my last post. Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top