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.

Re: help with datagrid in vb.net 80 80

DataGrid1.Item(rowindex,columnindex)

Re: help with datagrid in vb.net 80 80
cell_value = DataGrid1.Item(rowindex, columnindex)
Re: help with datagrid in vb.net 80 80

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

Re: help with datagrid in vb.net 80 80

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

Re: help with datagrid in vb.net 80 80

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 the SELECTED 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.

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.