We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,820 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

passing values from text box to data grid view??

How to pass values from textbox to datagridview in VB 2008????

4
Contributors
9
Replies
1 Day
Discussion Span
9 Months Ago
Last Updated
10
Views
HibaPro
Junior Poster
126 posts since Jun 2012
Reputation Points: -3
Solved Threads: 2
Skill Endorsements: 0

what do mean by passing values , are you want to add value in any cell ?

M.Waqas Aslam
Master Poster
743 posts since Aug 2011
Reputation Points: 50
Solved Threads: 120
Skill Endorsements: 2

Hello,

Try this:

datagridview1.Add(Textbox1.text)

Hope this helps.

Cronicle8
Light Poster
39 posts since Nov 2011
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

yes i need to add value to the first cell , how i can do this ?

i will try this code

HibaPro
Junior Poster
126 posts since Jun 2012
Reputation Points: -3
Solved Threads: 2
Skill Endorsements: 0

Try something like this
DataGridView1.Rows(1).Cells(1).Value = "Testing"
But you need to know in which row and which column you need to add value..

Pgmer
Practically a Posting Shark
881 posts since Apr 2008
Reputation Points: 60
Solved Threads: 158
Skill Endorsements: 1

HI Pgmer, i tried this , but when i need to enter next cell this DataGridView1.Rows(1).Cells(1).Value = "Testing"

one disappear?? do u have other option??

HibaPro
Junior Poster
126 posts since Jun 2012
Reputation Points: -3
Solved Threads: 2
Skill Endorsements: 0

disappear?? do u have other option
What you mean by disappear? Are you looping through? or static no of rows?

Pgmer
Practically a Posting Shark
881 posts since Apr 2008
Reputation Points: 60
Solved Threads: 158
Skill Endorsements: 1

i mean by disapper that the value donst show on the cell when i want to enter the next value in next cell, other option i need a correct code plz...

HibaPro
Junior Poster
126 posts since Jun 2012
Reputation Points: -3
Solved Threads: 2
Skill Endorsements: 0

It dissapears because you are overwritting a value. My example of code did not work?

Cronicle8
Light Poster
39 posts since Nov 2011
Reputation Points: 10
Solved Threads: 4
Skill Endorsements: 0

hi Cronicle , no it dosnt work , gave me an error.

HibaPro
Junior Poster
126 posts since Jun 2012
Reputation Points: -3
Solved Threads: 2
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0866 seconds using 2.66MB