Hello, Can you please help me?

Is it posible to input data on a "DATAGRID" even if it is not connected to a database?
My Datasource Connection is not working because of some installation problems. I don't have the CD for installation that is why I couldn't re-install it.

How can I input data from the "TEXTBOX" above, straight to the "DATAGRID" using the Buttons "ITEMS" . What I want to do is when I click on the Items Buttons it will automatically go to the "TEXTBOX" then it will be automatically ** added on the "DATAGRID"**...
How will it be DONE?

Recommended Answers

DataGrid.Rows(index).Cells(index / ColumnName).Value = TextBox1.Text
Jump to Post

All 4 Replies

DataGrid.Rows(index).Cells(index / ColumnName).Value = TextBox1.Text
Member Avatar

It is simple.
On button click do the following.

dataGridView1.Rows.Add (textBox1 .Text);

if you have multiple data then arrange it row wise in arguments.

dataGridView1.Rows.Add (textBox1 .Text,textbox2.text);

For more reference See Here

Thank you for quick responses!
Now I it works.
But the text joined at the same cell. What should I do.
I have come up with this code:

  1. Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  2. desiredWatermark.AppendText("Bag")
  3. DataGridView1.Rows.Add(Watermark1.Text + "Bag", Watermark1.Text + "8494839485", Watermark1.Text + "1234")
  4. End Sub

Great, Mark question solved please.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.