Grid view

  • Thread starter Thread starter Seema Multani
  • Start date Start date
S

Seema Multani

I have a gridview. How can I reterive a value in the Gridview or how can I
search through a column of a gridview for a specific value.

Thanks in advance
 
Pseudo code here:

For each row in the gridview:
Textbox t =(Findcontrol("The Control Name") as TextBox)
valuetocheck = t.text
 
You could try something like this..


void CustomersGridView_SelectedIndexChanged(Object sender, EventArgs e)
{

// Get the currently selected row using the SelectedRow property.
GridViewRow row = CustomersGridView.SelectedRow;

// Display the company name from the selected row.
// In this example, the third column (index 2) contains
// the company name.
Message.Text = "You selected " + row.Cells[2].Text + ".";

}
 
Back
Top