Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=80465 --- shadow/80465 2007-01-05 20:23:55.000000000 -0500 +++ shadow/80465.tmp.30005 2007-01-05 20:23:55.000000000 -0500 @@ -0,0 +1,89 @@ +Bug#: 80465 +Product: Mono: Class Libraries +Version: 1.1 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Wishlist +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Invalid argument crash in EndEdit + +1. Run code in Windows XP in .NET 2 profile +2. Activate grid cell +3. Press space bar + +Observed: + +Application exists + +Expected: + + Grid row must be deleted + +Code to reproduce: + +using System.Windows.Forms; +using System.Data; +static class Program { + static void Main() { + Application.Run(new Frm()); + } +} + +class Frm : Form { + public Frm() { + DataGrid dataGrid1 = new grid(); + DataSet dataSet1 = new DataSet(); + dataSet1.Tables.Add(); + dataSet1.Tables[0].Columns.Add(); + dataSet1.Tables[0].Rows.Add(); + dataGrid1.DataSource = dataSet1; + dataGrid1.DataMember = dataSet1.Tables[0].TableName; + Controls.Add(dataGrid1); + } +} + +class grid : DataGrid { + protected override bool ProcessCmdKey(ref Message msg, Keys +keyData) { + + GetCurrentRow().Delete(); + DataSet ds = (DataSet)DataSource; + for (int nTable = 0; nTable < ds.Tables.Count; nTable++) { + for (int nRow = 0; nRow < ds.Tables +[nTable].Rows.Count; nRow++) { + if (ds.Tables[nTable].Rows[nRow].HasVersion +(DataRowVersion.Proposed)) { + ds.Tables[nTable].Rows +[nRow].EndEdit(); + } + } + } + return true; + } + + + public virtual DataRowView GetCurrentRow() { + CurrencyManager cm = GetCurrencyManager(); + return (DataRowView)cm.Current; + } + + public virtual CurrencyManager GetCurrencyManager() { + return (CurrencyManager)BindingContext[ + DataSource, DataMember]; + } +} + +Stack trace: + +An invalid argument was specified. +at System.Data.Common.RecordCache.DisposeRecord (Int32 index) +at System.Data.DataRow.EndEdit () _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
