This is a migrated thread and some comments may be shown as answers.

How can I populate a series of textboxes when I click on a row in the GridView?

1 Answer 23 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 02 Feb 2009, 09:10 PM
I have a WindowsForm App that shows a list of users using RadGridView .
When you double click on a row on the GridView I pop up a second form containing textboxes.
I am trying to populate these boxes with the data from the selected row of the GridView.
I tried to use FindControl but that doesn't seem to work.

Does anyone have a piece of code in VB that will make this work?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Tim
Top achievements
Rank 1
answered on 02 Feb 2009, 09:54 PM
I figured it out on my own while I was waiting.

Private Sub UserEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load       

        RadTextBox1.Text = Main.RadGridView1.MasterGridViewInfo.CurrentRow.Cells("Company").Value.ToString
        RadTextBox2.Text = Main.RadGridView1.MasterGridViewInfo.CurrentRow.Cells("Contact").Value.ToString
        RadTextBox3.Text = Main.RadGridView1.MasterGridViewInfo.CurrentRow.Cells("Phone").Value.ToString
        RadTextBox4.Text = Main.RadGridView1.MasterGridViewInfo.CurrentRow.Cells("Email").Value.ToString
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Share this question
or