Displaying selected columns in a DdataGrid

G

Guest

I have a datagrid on my windows form. At design time, I set the DataSource
and DataMember. Then I added a TableStyle and set its MappingName to the
same value as the DataMember. Finally, I created GridColumnStyle for each 3
columns that I wanted to display. But When I run this application I get the 5
origial column display in the datagrid. What did I miss to didn't do?

Thanks
 
K

Ken Tucker [MVP]

Hi,

Post some code.

Ken
---------------
I have a datagrid on my windows form. At design time, I set the DataSource
and DataMember. Then I added a TableStyle and set its MappingName to the
same value as the DataMember. Finally, I created GridColumnStyle for each 3
columns that I wanted to display. But When I run this application I get the
5
origial column display in the datagrid. What did I miss to didn't do?

Thanks
 
C

Cor Ligthert

Reza,

Mostly is in this case the "datamember" not set from the tablestyle

I hope this helps?

Cor
 
G

Guest

Ken,

I have used the DataGrid's TablesStyles to create one TableStyles and used
GridColumnStyles to create the columns I want to display. When set the
MappingName of the GridColumnStyles, All the fields in table are shown in
the MappingName property of DataGridColumnStyles field.

For this part I have tried to avoid any coding.
 
G

Guest

Cor,

If I have 'datamember' of DataGrid and 'mappingname" of TablesStyles set to
the same value.
 

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