datagrid

  • Thread starter Thread starter Maarten
  • Start date Start date
M

Maarten

i want to use a dateagrid to show my variable statuses in.
i don't want to connect it with a database
how can i add simple text in a datagrid matrix

datagrid1.textmatrix(1,5) = var1 for example

thanks Maarten
 
You need to create a datatable, fill it with the data you want and then bind
it to the datagrid. I think there are other ways, but this is what I do
when I want to fill a DG w/ a DB.


Dim T as new DataTable
T.Columns.Add("Col 1")
T.Columns.Add("Col 2")
Dim R as DataRow
For ii as integer = 0 to 5
R = T.NewRow
R.Item(0) = ii
R.item(1) = "A Row is Added")
T.Rows.Add(R)
Next
DataGrid1.DataSource = T

That is the idea. I wrote the code in the message so it's not checked to
compile.

Good luck
Chris
 
You can put static data into dataset and bind that into a dataset. This is
often the easiest if there is a lot of data. You can use any other object
like an array to bind to a data grid too

Rgds,
Anand
VB.NET MVP
http://www.dotnetindia.com
 

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

Back
Top