2 Replies - 251 Views - Last Post: 17 June 2019 - 11:11 PM Rate Topic: -----

#1 petercheung   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-June 19

How To Get Data From Datagridview Row In The Text Boxes

Posted 17 June 2019 - 01:06 AM

I had added a Columns to a dataGridView
dataGridView1.Columns.Add("qty", "Quantity");



string valuetest = row.Cells[0].Value.ToString(); 
string valuetest1 = row.Cells[1].Value.ToString();
label1.Text = valuetest + valuetest1 ;



i can get the Cells[0] and Cells[1] value. how can I get the Quantity value?

Is This A Good Question/Topic? 0
  • +

Replies To: How To Get Data From Datagridview Row In The Text Boxes

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,197
  • Joined: 12-June 08

Re: How To Get Data From Datagridview Row In The Text Boxes

Posted 17 June 2019 - 06:57 AM

First - you should be using column names. Makes it a little more readable and you know what you are getting versus a position that you may have out of order.

Second, your column.add is wrong. Read up on the types of '.add' there are.
https://docs.microso...ng_System_Type_
Was This Post Helpful? 1
  • +
  • -

#3 petercheung   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-June 19

Re: How To Get Data From Datagridview Row In The Text Boxes

Posted 17 June 2019 - 11:11 PM

Thank

This post has been edited by Skydiver: 18 June 2019 - 03:40 AM
Reason for edit:: Removed unnecessary quote. No need to quote the post above yours.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1