Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use DataGrid

Status
Not open for further replies.

krshaikh

Programmer
Nov 18, 2001
45
US
Hi,

I am new to VB.Net. I have been using MSFlexGrid for quite a long time and trying to learn VB.Net's datagrid is becoming a problem. I want to use DataGrid exactly the same way as MSFlexGrid. I dont wanna use a datatable or dataset as there is none. I have to programatically create headers rows and display information in columns. Can anybody please show me how it can be done.

Regards,

- Krshaikh -
 
So far as I know the MS Datagrid has to be bound to a datasource such as a Table/View

However you could always add the MS Flex Grid as a COM component to your toolbox, or alternatively look at a flex grid from another source such as Component One.


Sweep
...if it works dont f*** with it
curse.gif
 
maybe you could use something like this?

Dim z(3)
Dim dt As New DataTable
dt.Columns.Add(New DataColumn("Account", GetType(String)))
dt.Columns.Add(New DataColumn("Name", GetType(String)))
dt.Columns.Add(New DataColumn("Accountvalue", GetType Decimal)))
dt.Columns.Add(New DataColumn("accountdesc", GetType(String)))
z(0) = 100
z(1) = "buzz"
z(2) = 100.00
z(3) = "this is a test
dt.Rows.Add(z)
DataGrid1.DataSource = dt
Me.DataGrid1.DataSource.newrow()


if it is to be it's up to me
 
Thankyou all. infinitelo, I am using somewhat like you suggested.

Regarsd,

- Kashif -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top