Hi
I've been all around looking for an answer to this question, but can't find it.
I've got a gridview with a single unbound column. It's got a textbox and button in the footer row. I"m trying to get the value from the textbox to add to the gridview on the button click. After trying to integrate other solutions into my code I've come up with this garbled mess in the button click event:
DataTable paramValues = new DataTable();
DataColumn ParameterValue = new DataColumn("Val ue", typeof(string)) ;
paramValues.Col umns.Add(Parame terValue);
foreach (GridViewRow row in gdvNewParameter Values.Rows)
{
paramValues.Row s.Add(row.Cells[0].ToString());
}
TextBox value = (TextBox)gdvNew ParameterValues .FooterRow.Cell s[0].FindControl("t xtNewParameterV alue");
TableCell tc = new TableCell();
tc.Text = value.Text;
TableRow tr = new TableRow();
tr.Cells.Add(tc );
paramValues.Row s.Add(tr);
gdvNewParameter Values.DataSour ce = paramValues;
gdvNewParameter Values.DataBind ();
Any ideas?
I've been all around looking for an answer to this question, but can't find it.
I've got a gridview with a single unbound column. It's got a textbox and button in the footer row. I"m trying to get the value from the textbox to add to the gridview on the button click. After trying to integrate other solutions into my code I've come up with this garbled mess in the button click event:
DataTable paramValues = new DataTable();
DataColumn ParameterValue = new DataColumn("Val ue", typeof(string)) ;
paramValues.Col umns.Add(Parame terValue);
foreach (GridViewRow row in gdvNewParameter Values.Rows)
{
paramValues.Row s.Add(row.Cells[0].ToString());
}
TextBox value = (TextBox)gdvNew ParameterValues .FooterRow.Cell s[0].FindControl("t xtNewParameterV alue");
TableCell tc = new TableCell();
tc.Text = value.Text;
TableRow tr = new TableRow();
tr.Cells.Add(tc );
paramValues.Row s.Add(tr);
gdvNewParameter Values.DataSour ce = paramValues;
gdvNewParameter Values.DataBind ();
Any ideas?
Comment