Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting only Relevant Columns on DataGrid

Status
Not open for further replies.

Ragnarox

Programmer
Oct 2, 2003
141
US
Hello all,

I have a datagrid that I setup a table style on. I put into it only the columns that I wanted to show. The other columns are used elsewhere on the page and are not needed in the DataGrid.

The problem is that the columns that I do not want on the DataGrid are still showing up on it after I bind it to the dataset.

Is there any way to stop that from happening within the table style collection? Or do I need to do something programmatically in order to get the desired effect?



Any help, as always, is greatly appreciated.

Brian
 
You can set the column widths to 0 for the ones you don't want to show.

For example:

Code:
dgLog.TableStyles(0).GridColumnStyles(0).Width = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top