protected override void HookSetDefaultValues(DataRow dataRow) { RolesDataSet.RolesRow row = (RolesDataSet.RolesRow)dataRow; row.rowguid = Guid.NewGuid(); }This seems to work fine unless I'm changing the roles for a user via the mmUsersForm. When you do and click "Save", the above hook method gets called, but it's not passed a RolesDataSet.RolesRow, but rather (I think by looking at the call stack) a DataRow from the UserRoles table.
> adc common business.dll!Adc.Common.Business.Roles.HookSetDefaultValues(System.Data.DataRow dataRow = {System.Data.DataRow}) Line 67 C# mere mortals framework.dll!OakLeaf.MM.Main.Business.mmBusinessObject.NewRow(System.Data.DataSet ds = {Adc.Common.Business.RolesDataSet}, string tableName = "UserRoles", System.Object defaultValues = <undefined value>) + 0x488 bytes mere mortals framework.dll!OakLeaf.MM.Main.Business.mmBusinessObject.NewRow(System.Data.DataSet ds = {Adc.Common.Business.RolesDataSet}, string tableName = "UserRoles") + 0x3c bytes mere mortals framework.dll!OakLeaf.MM.Main.Security.mmRole.UpdateUserRoles(System.Object userPK = {1}, System.Data.DataTable dtUserRoles = {Adc.Common.Business.RolesDataSet.RolesDataTable}) + 0x288 bytes mere mortals framework windows forms.dll!OakLeaf.MM.Main.Windows.Forms.mmUsersForm.mvrRoles_Save(OakLeaf.MM.Main.Business.mmBaseBusinessObject bizObj = {Adc.Common.Business.Users}, OakLeaf.MM.Main.Business.mmBusinessStateChangeEventArgs e = {OakLeaf.MM.Main.Business.mmBusinessStateChangeEventArgs}) + 0x49 bytesThanks,