Retrieve Unbound column cell data??
-
Hello Experts, I want to retrieve cell values from a gridview data row.There are unbound and bound columns in a row.I can retrieve values for bound columns but cannot get it for unbound columns. My code is like below: protected void Button1_Click(object sender, EventArgs e) { GridViewRow objRow = GridView1.SelectedRow; TextBox2.Text = objRow.Cells[41].Text; //bound column TextBox3.Text = objRow.Cells[42].Text; //!!!!unbound column!!!! } Please help.What is wrong?
-
Hello Experts, I want to retrieve cell values from a gridview data row.There are unbound and bound columns in a row.I can retrieve values for bound columns but cannot get it for unbound columns. My code is like below: protected void Button1_Click(object sender, EventArgs e) { GridViewRow objRow = GridView1.SelectedRow; TextBox2.Text = objRow.Cells[41].Text; //bound column TextBox3.Text = objRow.Cells[42].Text; //!!!!unbound column!!!! } Please help.What is wrong?
Do you have Visual Studio? Why not view your gridview row in the quick watch window and check the properties of the unbound column until you find your text...
I didn't get any requirements for the signature
-
Do you have Visual Studio? Why not view your gridview row in the quick watch window and check the properties of the unbound column until you find your text...
I didn't get any requirements for the signature
Thank you for your reply.Of course I did it...And the result is ""
-
Thank you for your reply.Of course I did it...And the result is ""
But there is text on the screen? Perhaps the test is stored in a different property. An easy solution is to create a template column. Add a label. Set the text of the label. Use gridviewrow.findcontrol("labelId") to get the label and its text property.
I didn't get any requirements for the signature