0

Hi
I have created three text boxes and a datagrid. Now if i select a row in the datagrid i want those cell values to be displayed in the corresponding textboxes. Can any body help me in this ascept.

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by Alekhan
0

Hi
I have created three text boxes and a datagrid. Now if i select a row in the datagrid i want those cell values to be displayed in the corresponding textboxes. Can any body help me in this ascept.

Hi
I have created three text boxes and a datagrid. Now if i select a row in the datagrid i want those cell values to be displayed in the corresponding textboxes. Can any body help me in this ascept.

0

to know which row is selected use this

DataGrid1.CurrentRowIndex

to show the value of first column in text box

Me.TextBox1.Text = DataGrid1.Item(DataGrid1.CurrentRowIndex, [B]0[/B])
0

to know which row is selected use this

DataGrid1.CurrentRowIndex

to show the value of first column in text box

Me.TextBox1.Text = DataGrid1.Item(DataGrid1.CurrentRowIndex, [B]0[/B])

Thanks for the reply. The code worked, now ihave created a button for email and i want to send the text which is in a textbox iam using " Me.mapiSession.SignOn() " for sending but i have missed some thing its not working. Can u help please. iam using .NET 2005 for this code.

Hope a soon reply.
Thanks and regards

0

Reply to your first query is as below!

Public strTest As String
Private Sub CONTCOLUMN()

Dim contcolumn As New DataGridViewTextBoxColumn

With contcolumn
.HeaderText = strTest
.Name = strTest

End With

DataGridView1.Columns.Insert(1, contcolumn)
End Sub
Public Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CB.SelectedIndexChanged

strTest = CB.SelectedItem
If strTest = "City" Then
CONTCOLUMN()
Else
MsgBox("YOU ARE IN THIS PHASE")
End If
End Sub

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.