Displaying a subset of table columns in a data grid

  • Thread starter Thread starter seb
  • Start date Start date
S

seb

Hi everyone,

I want a data grid to display only a subset of columns of a table of a
DataSet.

What I want is to display the id and name of customers in a grid. Then the
user can click on a row and see the full information about the customer in
some controls in the form.

I only way I found to do this is with 2 DataSets and 2 DataAdapters. The
first set would contain only a table with the 2 colums for the grid and the
other set has
all the columns.

I was wondering if there was a nicer way to do this (i.e. getting all the
information from one DataSet only). A DataView seems to be only able to show
all columns of a table.

Thanks

Seb
 
Add a TableStyle to your DataGrid, in that one add GridColumnStyles for each
column you want to show. Only those you specify will be showed then in the
DataGrid.

/Dan
 
It's working!
Thanks
Seb

Daniel Carlsson said:
Add a TableStyle to your DataGrid, in that one add GridColumnStyles for each
column you want to show. Only those you specify will be showed then in the
DataGrid.

/Dan
 
Back
Top