Mein Programm löst sporadisch den Fehler aus, ich selbst hatte ihn noch nicht und kann ich auch nicht reproduzieren.
Könnt ihr mir weiterhelfen und sagen, woran das liegen könnte?
Fehler:
PlayerDataTable
Könnt ihr mir weiterhelfen und sagen, woran das liegen könnte?
Fehler:
VB.NET-Quellcode
- ystem.InvalidOperationException: Die Zelle befindet sich nicht in einer DataGridView und kann den geerbten Zellstil nicht abrufen.
- bei System.Windows.Forms.DataGridViewCell.GetInheritedStyle(DataGridViewCellStyle inheritedCellStyle, Int32 rowIndex, Boolean includeColors)
- bei System.Windows.Forms.DataGridView.OnCellValidating(DataGridViewCell& dataGridViewCell, Int32 columnIndex, Int32 rowIndex, DataGridViewDataErrorContexts context)
- bei System.Windows.Forms.DataGridView.CommitEdit(DataGridViewCell& dataGridViewCurrentCell, DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave)
- bei System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts context, DataGridViewValidateCellInternal validateCell, Boolean fireCellLeave, Boolean fireCellEnter, Boolean fireRowLeave, Boolean fireRowEnter, Boolean fireLeave, Boolean keepFocus, Boolean resetCurrentCell, Boolean resetAnchorCell)
- bei System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(Int32 columnIndex, Int32 rowIndex, Boolean setAnchorCellAddress, Boolean validateCurrentCell, Boolean throughMouseClick)
- bei System.Windows.Forms.DataGridView.set_CurrentCell(DataGridViewCell value)
- bei System.Windows.Forms.DataGridView.OnClearingRows()
- bei System.Windows.Forms.DataGridViewRowCollection.ClearInternal(Boolean recreateNewRow)
- bei PlayerDataTable._Closure$__.c47e400f9fb3730f8246e6175770b711a()
PlayerDataTable
VB.NET-Quellcode
- Imports CustomPackets
- Namespace Interface
- Public Class PlayerDataTable
- Public Shared Sub Update(list As List(Of Player))
- Main.PlayersList.BeginInvoke(Sub() Main.PlayersList.Rows.Clear())
- Dim i = 0
- Do While (i < list.Count)
- Dim player = list(i)
- Dim timeStr = TimeSpan.FromSeconds(player.ConnectedSeconds).ToString("hh\:mm\:ss")
- Dim h1() As String = player.Health.Split("."c)
- Dim h2() As String = player.Address.Split(":"c)
- AddNewEntry(i, player.DisplayName, timeStr, h1.First, player.Ping, player.SteamID, h2.First)
- i += 1
- Loop
- Try
- Main.PlayersList.Rows(Main.Rowindex.Text).Selected = True
- Catch
- End Try
- End Sub
- Public Shared Sub AddNewEntry(number As Integer, playerName As String, timeConnected As String, h1 As String, ping As Integer, steamId As String, h2 As String)
- Dim row = New DataGridViewRow
- row.CreateCells(Main.PlayersList, number, playerName, timeConnected, h1, ping, steamId, h2)
- Main.PlayersList.BeginInvoke(Sub() Main.PlayersList.Rows.Add(row))
- End Sub
- End Class
- End Namespace