Bind control to data grid

desmondtan

Freshman
Joined
Dec 24, 2002
Messages
40
I used coding to bind datatable to datagrid

e:g

myDatagrid.Datasource = mytable

The table contains 4 column : CutomerID , OrderId , price , qty

How do I change the data grid to display only price and qty ?
 
go to the properties of the datagrid, go to the tablestyles options click on collections, add a tablestyle and then add as many gridcolumnstyles as you want, map the columns to your data columns, then give the columns you want to hide the width 0 and then is your problem solved.

greetz
 
Other, better way is not to create column styles for columns you don't want to display, instead of creating it and hiding it with width=0!
 
Back
Top