954,517 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help with datagrid in vb.net

I was wondering if anyone knows how to get text from a cell in a datagrid into a message box or text box? Thanks in advance.

atv161
Newbie Poster
8 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

DataGrid1.Item(rowindex,columnindex)

hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 
cell_value = DataGrid1.Item(rowindex, columnindex)
Comatose
Taboo Programmer
Team Colleague
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
 

Hi

Can any one please guide me how can i use the Combo box in any of the columns in DATAGRID control in vb.net forms .

Thank & Regards
Manish Kaushik

manishkaushik
Newbie Poster
6 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

cell_value = DataGrid1.Item(rowindex, columnindex) -------> on what event it should be posted? Thanks. God Bless. :D

paulablanca
Junior Poster in Training
78 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 
I was wondering if anyone knows how to get text from a cell in a datagrid into a message box or text box? Thanks in advance.

You can get the first cell (ie. cell(0)) of theSELECTED row, and send it to TextBox1 by the following code:

TextBox1.Text = ContactInfoDataGridView.CurrentRow.Cells(0).Value.ToString


For the 2nd cell ... use cell(1), for 3rd use cell(2), and so on.

mikeybware
Light Poster
32 posts since Dec 2009
Reputation Points: 8
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You