Solved

Disable Row of Datagridview

Posted on 2011-03-17
3
326 Views
Last Modified: 2012-05-11
I am filling a datagridview and I want to be able to disable certain rows where a boolean is true.

Thanks in advance
Private Sub dgFeedback_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles dgFeedback.CellFormatting
        Dim drvFeedback As DataRowView
        If e.RowIndex >= 0 Then
            drvFeedback = dtFeedback.DefaultView.Item(e.RowIndex)
            If drvFeedback.Item("bAck") = True Then

            End If
        End If
    End Sub

Open in new window

0
Comment
Question by:mgordon-spi
  • 2
3 Comments
 
LVL 6

Expert Comment

by:nandithaa
ID: 35162998
0
 

Author Comment

by:mgordon-spi
ID: 35169736
I have already looked at that link, I can't see how to disable particular rows with that. If you can I would appreciate it.
0
 
LVL 6

Accepted Solution

by:
nandithaa earned 500 total points
ID: 35170687
I don't know your table structure. So check if this helps or not....

Private Sub dgFeedback_CellFormatting(sender As Object, e As System.Windows.Forms.DataGridViewCellFormattingEventArgs)
	Dim drvFeedback As DataRowView = Nothing
	If e.RowIndex >= 0 Then
		drvFeedback = dtFeedback.DefaultView.Item(e.RowIndex)

		If drvFeedback("bAck") = True Then
			For Each drgv As DataGridViewRow In dgFeedback.Rows
				If drvFeedback("Id").ToString() = drgv.Cells("Id").Value.ToString() Then
					drgv.[ReadOnly] = True
				End If
			Next
		End If
	End If
End Sub

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question