Displaying a subset of table columns in a data grid

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
 
D

Daniel Carlsson

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
 
S

seb

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
 

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