or
hello
I am using a radgrid with a master table view and details table, I can update my master table view with a stored procedure however I cannot update detail table with another stored procedure. The two updates must be done simultaneously with the save button of radgrid in edit mode.
Here is what I did for my master table view, it works and i would like to do the same button on my detail table, Can you help me pls
protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
string pID_OF = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID_OF"].ToString();
string pNO_WO = (editedItem["NO_OF"].Controls[0] as TextBox).Text;
string pRef = (editedItem["CodeArticle"].Controls[0] as TextBox).Text;
string pQte = (editedItem["QteLancee"].Controls[0] as TextBox).Text;
string pStatut_WO = (editedItem["StatutOF"].Controls[0] as TextBox).Text;
string pDate_WO = (editedItem["DateLancement"].Controls[0] as TextBox).Text;
string pID_Affectation = (editedItem["ID_Affectation"].FindControl("RadCombobox1") as RadComboBox).SelectedValue;
try
{
SqlDSListeOF.UpdateParameters["pID_OF"].DefaultValue = pID_OF;
SqlDSListeOF.UpdateParameters["pNO_WO"].DefaultValue = pNO_WO;
SqlDSListeOF.UpdateParameters["pRef"].DefaultValue = pRef;
SqlDSListeOF.UpdateParameters["pQte"].DefaultValue = pQte;
SqlDSListeOF.UpdateParameters["pStatut_WO"].DefaultValue = pStatut_WO;
SqlDSListeOF.UpdateParameters["pDate_WO"].DefaultValue = pDate_WO;
SqlDSListeOF.UpdateParameters["pID_Affectation"].DefaultValue = pID_Affectation;
SqlDSListeOF.Update();
}
catch (Exception ex)
{
e.Canceled = true;
ErrorAffectation.Text = "Impossible de mettre à jour . " + ex.Message;
}
}