Bug 5510 - Another crash while clicking around data grid based on sample code from another project
Summary: Another crash while clicking around data grid based on sample code from anoth...
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: unspecified
Hardware: Other All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-06-04 07:43 UTC by Robert Wilkens
Modified: 2012-07-21 16:47 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Robert Wilkens 2012-06-04 07:43:42 UTC
Description of Problem:
I'm not sure i know exactly what i clicked, but i was playing around with the application from the sample code here:


For the most part, after my previous patch, it ran a lot better, but i had two crashes while using it.  Not sure whether or not they are related, but here is one of the stack traces in case anyone wants to try to troubleshoot further:

System.ArgumentException: id is neither a DataColumn nor a DataRelation for table pc
  at System.Data.DataRowView.get_Item (System.String property) [0x00000] in <filename unknown>:0 
  at System.Data.DataColumnPropertyDescriptor.GetValue (System.Object component) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGridColumnStyle.GetColumnValueAtRow (System.Windows.Forms.CurrencyManager source, Int32 rowNum) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGridTextBoxColumn.GetFormattedValue (System.Windows.Forms.CurrencyManager source, Int32 rowNum) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGridTextBoxColumn.Edit (System.Windows.Forms.CurrencyManager source, Int32 rowNum, Rectangle bounds, Boolean readOnly, System.String displayText, Boolean cellIsVisible) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.Edit () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.ScrollToColumnInPixels (Int32 pixel) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.EnsureCellVisibility (DataGridCell cell) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.set_CurrentCell (DataGridCell value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.NavigateBack () [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.DataGrid.OnMouseUp (System.Windows.Forms.MouseEventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0 

I believe at one point i had 'id' as one of the columns displayed, perhaps with 'pc' and perhaps that is the source of the error.  

The data file (xml) has both 'pc' and 'id' in it, but not directly related:
   ... (repeat pd contents over and over) ....

Steps to reproduce the problem:
1. Not sure, but built code from other sample mentioned above
2. Applied fix from https://bugzilla.xamarin.com/show_bug.cgi?id=5487 which lets me at least expand a column in the first place rather than crashing there.  This should have no effect on this particular crash.
3. Clicked around the app in various ways, including, but not limited to, the "+" button and select pa/pb/pc/pd randomly, and pressing the two arrow buttons on the top right of the application, until it crashes.  Not sure which click caused the crash unfortunately.

Actual Results:

Expected Results:

How often does this happen? 

Additional Information:
Comment 1 Robert Wilkens 2012-06-04 14:08:55 UTC
I might've accidentally fixed this (that fix not yet accepted) while i was working on the other problem i reported:


Because after i fixed that issue, I click around all over and couldn't make it crash.  The output still isn't matching what it should be necessarily, but at least it doesn't crash anymore.

One of the issues that remains, for example, is already reported here:
That is: there is an extra column displayed which needs to be tracked down, but it is unrelated to this problem.  I'll try to work on that other problem too.
Comment 2 Robert Wilkens 2012-07-21 16:47:05 UTC
The fix for this was merged in p.r. 335.