Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomly getting NullReferenceException #254

Open
Goddfrey opened this issue Jan 11, 2024 · 0 comments
Open

Randomly getting NullReferenceException #254

Goddfrey opened this issue Jan 11, 2024 · 0 comments

Comments

@Goddfrey
Copy link

Goddfrey commented Jan 11, 2024

.NET 8.0

Exception occurs sometimes randomly, but there's one scenario when it happens 100 % of the time:

Windows Form with KryptonDataGridView is open. I choose "settings" from the menu strip. SettingsForm.ShowDialog() opens (that has no datagridview). I click OK, settings form closes, main form with KryptonDataGridView is an active window again. I do nothing at all. In about 4 - 6 seconds it crashes with this exception.

There's no code of my own that would track mouse cursor or anything like that.

    at Krypton.Toolkit.KryptonDataGridViewButtonCell.get_MouseInContentBoundsInternal()
   at Krypton.Toolkit.KryptonDataGridViewButtonCell.Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, Object value, Object formattedValue, String errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewCellPaintingEventArgs.Paint(Rectangle clipBounds, DataGridViewPaintParts paintParts)
   at Krypton.Toolkit.KryptonDataGridView.OnCellPainting(DataGridViewCellPaintingEventArgs e)
   at System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex, DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.PaintCells(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow, DataGridViewPaintParts paintParts)
   at System.Windows.Forms.DataGridViewRow.Paint(Graphics graphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex, DataGridViewElementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
   at System.Windows.Forms.DataGridView.PaintRows(Graphics g, Rectangle boundingRect, Rectangle clipRect, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean singleHorizontalBorderAdded)
   at System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Krypton.Toolkit.KryptonDataGridView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant