database configuration:
Activity: (parent)
ActivityID (Primary Key)
EstimateItem: (child)
EstimateItemID (Primary Key)
ActivityID (Foreign Key)
What is required in the UltraWebGrid or SqlDataSource settings to insert a child record and pull the parent Primary key to populate the child table Foreign Key? Do I need to set a control parameter = ???
Hi,
You can use the Grid's UpdateRow event. Call an insert statement for the parent and assign the value that comes back from the server to the child. If the identity field is the first column in both the Parent and Child, then your code would look similar to:
protected
void UltraWebGrid1_UpdateRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
{
if (e.Row.DataChanged.ToString() == "Modified")
}
e.Row.Cells[0].Value = order;
e.Row.Cells[0].Value = e.Row.ParentRow.Cells[0].Value;
Class1 myclass =
new Class1();