Results 1 to 2 of 2

Thread: Formatting columns

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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


  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You have to change the width of the datagrid column to show different sizes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width