DataBinding Question

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

if i have a dataset which has 1 dataTable,
if that DT, it has 10 columns,
how can I do to display only 5 selected columns in the dataGrid in the
form??
 
Hi Jason,

Use the DataGridTableStyle class and its GridColumns collection to customize
the set of visible columns.
 
thx

Dmitriy Lapshin said:
Hi Jason,

Use the DataGridTableStyle class and its GridColumns collection to customize
the set of visible columns.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Jason said:
if i have a dataset which has 1 dataTable,
if that DT, it has 10 columns,
how can I do to display only 5 selected columns in the dataGrid in the
form??
 
by the way
do u have any sample??

Dmitriy Lapshin said:
Hi Jason,

Use the DataGridTableStyle class and its GridColumns collection to customize
the set of visible columns.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

Jason said:
if i have a dataset which has 1 dataTable,
if that DT, it has 10 columns,
how can I do to display only 5 selected columns in the dataGrid in the
form??
 
is it I create a new dataTable and add the columns that I need and fill the
data from the dataset to the dataTable and then bind the data??
 
thx

ClayB said:
You could, but you do not have to. You need to create a DataGridTableStyle
object and add it to the dataGrid1.TableStyles collection. Attached is a
sample.


==============================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
 
Back
Top