L
luna
getting frustrated - cant seem to find the info i need to complete im just
going round in circles
(most things ive read are inline code....)
im using asp.net with vb codebehind - im trying to format the columns in
codebehind
with this code
Dim strConn As String = "usual connection string stuff"
Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "select * from diary"
'Dim da As New System.Data.SqlClient.SqlCommand(sql, conn)
Dim da As New System.Data.sqlclient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
conn.Open()
i need to format the columns somehow
in vb i know its something like
Dim ts As New DataGridTableStyle()
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
ts.GridColumnStyles(0).Width = 110
ts.GridColumnStyles(1).Width = 90
ts.GridColumnStyles(2).Width = 100
ts.GridColumnStyles(3).Width = 90
ts.GridColumnStyles(4).Width = 250
not sure what the equivalent is
going round in circles
(most things ive read are inline code....)
im using asp.net with vb codebehind - im trying to format the columns in
codebehind
with this code
Dim strConn As String = "usual connection string stuff"
Dim conn As New System.Data.SqlClient.SqlConnection(strConn)
Dim sql As String = "select * from diary"
'Dim da As New System.Data.SqlClient.SqlCommand(sql, conn)
Dim da As New System.Data.sqlclient.SqlDataAdapter(sql, conn)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataSource = ds
DataGrid1.DataBind()
conn.Open()
i need to format the columns somehow
in vb i know its something like
Dim ts As New DataGridTableStyle()
ts.MappingName = "Table"
DataGrid1.TableStyles.Clear()
DataGrid1.TableStyles.Add(ts)
Me.DataGrid1.DataSource = ds.Tables(0)
ts.GridColumnStyles(0).Width = 110
ts.GridColumnStyles(1).Width = 90
ts.GridColumnStyles(2).Width = 100
ts.GridColumnStyles(3).Width = 90
ts.GridColumnStyles(4).Width = 250
not sure what the equivalent is