473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DataTable Formatting(Width) Question

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
Nov 19 '05 #1
0 853

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: gro.asumsa | last post by:
I have two DataTables in a DataSet. I would like to create a third DataTable in the same DataSet that is a Join of the two original DataTables. The two tables are extracted from two different...
2
by: | last post by:
Hello all I have a dataset which contains 3 datatables. I traverse each datatable and check the rows. I should be able to get values out of these datatables and create a new datatable? Is this...
1
by: Maziar Aflatoun | last post by:
Hi, I have two datatables, DataTable1 dtCurProducts.Columns.Add(new DataColumn("Id", Type.GetType("System.String"))); dtCurProducts.Columns.Add(new DataColumn("ProductId",...
3
by: Tim::.. | last post by:
Can someone please tell me how I add information to a datatable! I already have some information that has been pulled from an Active Directory Database but I want to add additional information...
2
by: nate axtell | last post by:
After binding a DataGrid and a few TextBoxes to the same DataTable in VB ..NET I successfully see the TextBoxes update when I change the selection in the DataGrid. I put DataGrid1.Invalidate() in...
0
by: Matthew | last post by:
I have a SQLDataSource object declared in my ASPX page. <asp:SqlDataSource ID="SqlDataSource1" runat="server" etc.. etc.. /> I pipe that query into a GridView, but I also want to populate the...
1
by: Marcel Hug | last post by:
Hello NG ! I have a tricky question about dataSet and dataTable. In my app I have 2 databases. In the first (called A1) database are the whole datas but I'm interesting in one table tbl1 (with 20...
7
by: Steven D'Aprano | last post by:
I have a sinking feeling I'm missing something really, really simple. I'm looking for a format string similar to '%.3f' except that trailing zeroes are not included. To give some examples: ...
3
by: ConfusedMay | last post by:
Hi, I have a quick question. Is there an option for conditional formatting in access 97? or is it only for access 2000 or higher? I need to change font color in access 97 report depending on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.