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 + ".";

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top