protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int Uid = Convert.ToInt32(this.GridView1.DataKeys[e.RowIndex]["id"]);
string value = (this.GridView1.Rows[e.RowIndex].FindControl("txt_value") as TextBox).Text.ToString();
int orderid = Convert.ToInt32((this.GridView1.Rows[e.RowIndex].FindControl("txt_orderid") as TextBox).Text);
string ddIs_other = (this.GridView1.Rows[e.RowIndex].FindControl("ddIs_other") as DropDownList).SelectedValue.ToString();
string ddIs_default = (this.GridView1.Rows[e.RowIndex].FindControl("ddIs_default") as DropDownList).SelectedValue.ToString();
string ddIs_otherinput = (this.GridView1.Rows[e.RowIndex].FindControl("ddIs_otherinput") as DropDownList).SelectedValue.ToString();
var updateOne = addup.tbSurveyResultChoices.Where(a => a.id == Uid);
tbsrc = updateOne.Single();
tbsrc.order_id =orderid;
tbsrc.value = value;
if (ddIs_other == "True")
{
tbsrc.is_other = true;
}
else
{
tbsrc.is_other = false;
}
if (ddIs_default == "True")
{
tbsrc.is_default = true;
}
else
{
tbsrc.is_default = false;
}
if (ddIs_otherinput == "True")
{
tbsrc.is_otherinput = true;
}
else
{
tbsrc.is_otherinput = false;
}
addup.SubmitChanges();
this.GridView1.EditIndex = -1;
bindgv();
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
this.GridView1.EditIndex = e.NewEditIndex;
bindgv();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
this.GridView1.EditIndex = -1;
bindgv();
}