-
Formatting columns
I have used the following code to create a datatable, create 3 columns and
add a row:
Dim dsPick As New DataSet()
Dim dtPick As New DataTable("Pick")
dsPick.Tables.Add(dtPick)
dtPick.Columns.Add(New DataColumn("Col1", GetType(String)))
dtPick.Columns.Add(New DataColumn("Col2", GetType(String)))
dtPick.Columns.Add(New DataColumn("Col3", GetType(String)))
Dim row As DataRow
row = dtPick.NewRow()
row(0) = Me.txtCode.Text
row(1) = Me.txtDescription.Text
row(2) = Me.txtQuantity.Text
dtPick.Rows.Add(row)
This is used as the source for a datagrid:
Me.datagrid1.DataSource = Me.dtPick
Unfortunatly all the columns are the same size.
How can I alter their width in code? and is it possible to use this
datatable as the source for a Crystal report?
Thanks In Advance
:confused:
-
You have to change the width of the datagrid column to show different sizes.