Heike Posted February 26, 2003 Posted February 26, 2003 I created a DataGridNoActiveCellColumnMultiple by inheriting from DataGridTextBoxColumn. I overloaded the paint procedure: Protected Overloads Overrides Sub Paint(ByVal g As Graphics, ByVal bounds As Rectangle, ByVal source As CurrencyManager, ByVal rowNum As Integer, ByVal backBrush As Brush, ByVal foreBrush As Brush, ByVal alignToRight As Boolean) Try If Not mblnMitKonvertierung Then MyBase.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight) Else Select Case mintKonvertierung Case enmKonvertierungsArt.kaZugriffsart Dim intZugriff As Integer intZugriff = CInt(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Zugriffsart")) MyBase.PaintText(g, bounds, mstrZugriff(intZugriff), backBrush, foreBrush, alignToRight) Case enmKonvertierungsArt.kaBenutzer Dim strKuerzel As Char Dim strGruppe As String strKuerzel = CChar(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Icon")) strGruppe = CStr(CType(source.Current, DataRowView).DataView.Table.Rows(rowNum).Item("Benutzer")) MyBase.PaintText(g, bounds, mstrName(strKuerzel, strGruppe), backBrush, foreBrush, alignToRight) End Select End If Catch ex As System.Exception 'do something End Try End Sub Now, sometimes (not reproduceable) I get following error: The object is currently in use elsewhere Unfortunately I have no idea what to do?! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.