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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying certain colums from a tpyed dataset

Status
Not open for further replies.

Norviking

Programmer
Nov 2, 2002
33
NO

Hi..

How can I display certain colums from a dataset in a Datagrid? I dont want to display the entire dataset, just a few colums.

Plz help
 
If you are using a datagrid in a web form, the DataGridColumn(s) have a Visible property. Use the DataGrid.DataGridColumn().Visible property to programmatically control whether the column is visible in the DataGrid control.

However, from your email, I expect you are asking about dataGrids in Windows Forms which does *not* have this rather handy property. I have only been able to control the content by changing the dataset or SQL query which fills the set.

DataGrids for Windows Forms seem to use the model that you have to create a "view" of the data that you want to display by manipulating the underlying dataset or a datatable. This is probably what you were trying to avoid.
---
dino
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top