Click here to Skip to main content
15,916,398 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void EditRecord(object sender, GridViewEditEventArgs e)
    {
      GridViewRow row = (GridViewRow)GridView1.Rows[e.NewEditIndex];
      int autoid = Int32.Parse(GridView1.DataKeys["autoid"].Value.ToString());
      TextBox name = (TextBox)row.FindControl("name1");
      RadioButtonList gender = (RadioButtonList)row.FindControl("gender");
      ListBox qualification = (ListBox)row.FindControl("qualification1");
    
      BindData();
    
    }

I am trying to display the row i have clicked in a label;
my label id = autoid

[edit: formatting]
Posted
Updated 22-Nov-10 0:03am
v2
Comments
Sandeep Mewara 22-Nov-10 6:12am    
Ok. So? Did I miss the question?

1 solution

Is the question:
1.) 'How do I assign the 'autoid' integer to be displayed in a label?'
2.)'How do I display all the values of the row I selected in a label?'

Then possible answers are:
1.)You need to assign the integer to the label.Text property.
label.Text = autoid.ToString();


2.)You need to create a string that holds all the values you want to include in it and then assign it to the label.Text property.
label.Text = string.Format("ID: {0}, Name: {1}", auotid, name.Text);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900