locked
gridview problem (angel) - 12/30/2007 7:02 AM PST RRS feed

  • Question

  • By: angel


    hi.. if i have a gridview.. which display names.. how do i click on each row 
    in the gridview and bring out all the data of that name to the textboxsssss..
    
    i tried previously in listbox
     if (listBox1.SelectedIndex != -1)
                {
                    
    //MessageBox.Show(store.Rows[listBox1.SelectedIndex].ItemArray[0].ToString());
                    foreach (DataRow row in store.Rows)
                    {                    
                        if (row[0].ToString() == 
    store.Rows[listBox1.SelectedIndex].ItemArray[0].ToString())
                        {
                            name.Text = row[1].ToString();
                            address.Text = row[2].ToString();
                            phone.Text = row[3].ToString();
                        }
                        else
                        {
                            //MessageBox.Show("lkfsdlff");
                        }
    
                    }
                }
    
    but i want that to be in gridview.. 
    Friday, February 22, 2008 3:22 PM