Datagrid question about columns

G

Guest

Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a dataset.

the datagrid fills up with the columns (prodno, description, price , siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,
 
K

Ken Tucker [MVP]

Hi,

Add a tablestyle to your datagrid.

http://msdn.microsoft.com/library/d...tingwindowsformsdatagridvisualbasicprimer.asp

http://msdn.microsoft.com/library/d...ry/en-us/dnwinforms/html/wnf_custdatagrid.asp

Ken
------------------
Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a dataset.

the datagrid fills up with the columns (prodno, description, price , siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,
 
G

Guest

Here is the Solution,

Create a Tablestyle.

Create Column Styles, only for the columns u want to show.

add the column Styles to the TableStyle.

Add the TableStyle To the DataGridColumnStyles collection
 

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