citizenzen
Programmer
I created a customized gridview. i added my major columns and I need to add a templatefield. i want to include a button in the template field, but everything i try seems to fail. how can i programmatically add a button?
I get the following error:
CS1502: The best overloaded method match for 'System.Web.UI.WebControls.GridViewRowCollection.this[int]' has some invalid arguments
I have the following code:
I get the following error:
CS1502: The best overloaded method match for 'System.Web.UI.WebControls.GridViewRowCollection.this[int]' has some invalid arguments
I have the following code:
Code:
TemplateField tf1 = new TemplateField();
BoundField ap1 = new BoundField();
BoundField ap2 = new BoundField();
Button mylocation;
mylocation = (Button)testDetailsGV.Rows[mrow.FindControl("locateBtn")];
tf1.ItemTemplate = mylocation;
tf1.HeaderText = "Locate";
tf1.Visible = true;
ap1.DataField = "DetailsID";
ap1.HeaderText = "#";
ap2.DataField = "Name";
ap2.HeaderText = "User";
testDetailsGV.Columns.Add(tf1);
testDetailsGV.Columns.Add(ap1);
testDetailsGV.Columns.Add(ap2);