rows. a) How do I determine how many rows are needed and then b) how
<vb2ae@bellsouth.net> wrote:
>Hi,
>
>
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q871q
>
>Ken
>--------------------
><max> wrote in message news:dfp4d1hinu5kd3g3f0n0duuv0apbplr7k0@4ax.com...
>I am trying to set the witdth of the datagrid's 1st column so that the
>second column butts up next to the edge. But this doesn't work. Any
>ideas??
>
> Dim colJD As New DataColumn
> Dim colAmt As New DataColumn
> 'Define Column Job Description
> colJD.DataType = System.Type.GetType("System.String")
> colJD.ColumnName = "JobDescription"
> colJD.Caption = "Job Description"
> colJD.ReadOnly = False
> tblJD.Columns.Add(colJD)
> 'Define Column Amount
> colAmt.DataType = System.Type.GetType("System.Decimal")
> colAmt.ColumnName = "Amount"
> colAmt.Caption = "Amount"
> colAmt.ReadOnly = False
> tblJD.Columns.Add(colAmt)
> dgJobDesc.DataSource = tblJD
>
> Dim ts As New DataGridTableStyle
> ts.MappingName = "JobDescription"
> Dim textcol As New DataGridTextBoxColumn
> textcol.MappingName = "JobDescription"
> textcol.HeaderText = "Job Description"
> textcol.Width = 300
> textcol.ReadOnly = False
> ts.GridColumnStyles.Add(textcol)
>
> DirectCast(dgJobDesc.DataSource, _
> DataTable).DefaultView.AllowNew = False
> dgJobDesc.TableStyles.Add(ts)
>
>
>Thank you,
>--max
>