DataTable Formatting(Width) Question

G

Guest

I have the following Code and I am looking to set the first column to 200
pixels. How do I do this?

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim IPERIOD As Integer = CInt(Request.QueryString("PERIOD")) - 1
Dim cfa As Object
Dim Data As String
Dim ds As New DataTable
Dim i As Integer
Dim x As Integer
Dim Rows() As String
Dim Fields() As String


ds.Columns.Add("Item", GetType(System.String))

For i = 1 To IPERIOD
ds.Columns.Add("Year " & i, GetType(System.String))
Next

Try
Rows = Split(Data, "|")

For i = 0 To UBound(Rows)
Fields = Split(Rows(i), ",")

Dim dr As DataRow
dr = ds.NewRow

For x = 0 To UBound(Fields) - 1
If i = 9 Or i = 10 Or i = 18 Then
If x = 0 Then
dr(x) = Fields(x).ToString
Else
dr(x) = Fields(x) & "%"
End If
Else
If x = 0 Then
dr(x) = Fields(x).ToString
Else
dr(x) = FormatCurrency(Fields(x))
End If

End If
Next
ds.Rows.Add(dr)
Next
Catch ex As Exception
Response.Write(ex.Message)
End Try


grdCashFlow.DataSource = ds
grdCashflow.DataBind()
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top