Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...