protected void dgrdEditor_UpdateCommand(object source, DataGridCommandEventArgs e) { // Get the item to be updated this.dgrdEditor.EditItemIndex = e.Item.ItemIndex; // Retrieve the previous entity DataSet DataSet dsEditor = (DataSet)Session["dsEditor"]; // Save the DataSet (the DataGrid automatically binds back) if (this.Save(this.oEditor, dsEditor) == mmSaveDataResult.RulesBroken) { this.lblErrorMsg.Text = this.oEditor.Rules.GetAllBrokenRules(); } // Reset the edited item and rebind the DataGrid this.dgrdEditor.EditItemIndex = -1; this.BindControl(this.dgrdEditor); }When adding a row to the datagrid, using the Jump start code, shouldn't the table defaults be present in the datagrid column?
protected void btnAddEditor_Click(object sender, EventArgs e) { // Retrieve the previous entity DataSet DataSet dsEditor = (DataSet)Session["dsEditor"]; // Add a new row to the DataSet this.oEditor.NewRow(dsEditor, this.oEditor.TableName, new TblEditorDefaults(1, 1)); // Store the DataSet back into the session Session["dsEditor"] = dsEditor; // Set the new row for editing this.dgrdEditor.EditItemIndex = dsEditor.Tables[this.oEditor.TableName].Rows.Count - 1; // Rebind the GridView this.BindControl(this.dgrdEditor); }