Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done
Private Sub dgCompounds_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles dgCompounds.CellPainting
 
        Try
 
            '-------------------------------------------------------------------------------------------------
            'if POS = <blank> , hide 'Punch' checkbox in cell
            '-------------------------------------------------------------------------------------------------
 
            If e.RowIndex > -1 And e.ColumnIndex > -1 Then
 
                If Me.dgCompounds.Columns(e.ColumnIndex).Name = "Punch" Then
                    Dim Pos As String = Me.dgCompounds.Rows(e.RowIndex).Cells(PosColumn).Value.ToString.Trim
                    If Pos = "" Then
                        e.Paint(e.ClipBounds, DataGridViewPaintParts.Background)
                        e.Handled = True
                    End If
                End If
            End If
 
        Catch ex As Exception
        Finally
            'skipMe = False
        End Try
    End Sub
Posted on Wednesday, October 20, 2010 9:56 AM GridView, Datagrid, DataList & Repeater | Back to top


Comments on this post: windows datagridview hide cell CellPainting

# re: windows datagridview hide cell CellPainting
Requesting Gravatar...
nice articlle for us
Left by FREE AFRICA BOOKS on Mar 21, 2011 10:03 AM

# re: windows datagridview hide cell CellPainting
Requesting Gravatar...
This is a superlative post. What i was actually looking for the past couple of hours. Thanks for the contribution and in truth treasure your effort.
Left by OMAK SEO Services UK on Sep 15, 2011 1:06 AM

# re: windows datagridview hide cell CellPainting
Requesting Gravatar...
I have subscribed to your rss feed which must do the trick! Thanks a lot for sharing, love your site and content, it was outstanding to read.
Left by SriLankan Airlines on Sep 19, 2011 4:18 AM

# re: windows datagridview hide cell CellPainting
Requesting Gravatar...
This is a outstanding article. This is what i was truly looking for the past 2 hours. Thanks for the contribution and in truth treasure your effort.
Left by SriLankan Airlines on Sep 19, 2011 4:18 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net