Below is the code I'm using to dynamically fill a datagrid from a
datatable (fed by an ole connection). Everything is working great
except that my users have to click 2 time on the checkbox to select it,
and if they click on it again it gets greyed out... click on the check
again and then it disapears.
What I want is to be able to be able to:
Click on the box once to check it.
Click on it again to remove the check.
How do you fix this issue?
Dim sql As String = "select A, b, c, d...."
Dim sConnString As String = _
"Provider.. .."
Dim myConnection As New OleDbConnection
dgResults.DataS ource = dt
dt.Columns.Add( "Yes/No", System.Type.Get Type("System.Bo olean"))
dt.Columns.Add( "Number", System.Type.Get Type("System.St ring"))
dt.Columns.Add( "LOT", System.Type.Get Type("System.St ring"))
dt.Columns.Add( "House", System.Type.Get Type("System.St ring"))
dt.Columns.Add( "Node", System.Type.Get Type("System.St ring"))
Dim dr As DataRow
dr = dt.NewRow
Try
myConnection = New OleDb.OleDbConn ection(sConnStr ing)
Dim myCommand As New OleDbCommand(sq l, myConnection)
myConnection.Op en()
Dim myReader As OleDbDataReader = myCommand.Execu teReader
Dim intCounter As Integer = 0
While myReader.Read()
dr = dt.NewRow
dr(0) = False
dr(1) = myReader(0)
dr(2) = myReader(1)
dr(3) = myReader(2)
dr(4) = myReader(3)
dt.Rows.Add(dr)
intCounter += 1
End While
txtCount.Text = CType(intCounte r, String)
myReader.Close( )
myConnection.Cl ose()
myConnection.Di spose()
Catch
Console.Out.Wri teLine("Error: " & Err.Description )
myConnection.Cl ose()
myConnection.Di spose()
End Try