This my code.. I want to get the CASE ID value if the checkbox is checked ...
Can u give me some idea ... thx Rekha
Private m_MyBoolColumn As Boolean
Private Function ProcessSearchQuery() As String
Dim sqlClientConnection As New SqlConnection(strConn)
Dim eblsDotNetDataAdapter As New SqlDataAdapter()
eblsDotNetDataAdapter.SelectCommand = New SqlCommand(StrSql,
sqlClientConnection)
Dim myDS As DataSet = New DataSet()
eblsDotNetDataAdapter.Fill(myDS, "MyTable")
numRecords = myDS.Tables(0).Rows.Count()
If numRecords > 0 Then
dgCases.CaptionText = "Found : " & numRecords & " matching
records."
FormSizeReset(575, 500)
Dim ts As New DataGridTableStyle()
ts.MappingName = myDS.Tables(0).TableName
Dim dc As New DataColumn("MyBoolColumn", GetType(Boolean))
dc.DefaultValue = False
myDS.Tables("MyTable").Columns.Add(dc)
Dim txtID6 As New DataGridBoolColumn()
txtID6.MappingName = "MyBoolColumn"
txtID6.HeaderText = "CHECKBOX"
txtID6.AllowNull = False
txtID6.Width = 80
ts.GridColumnStyles.Add(txtID6)
Dim txtID0 As New DataGridTextBoxColumn()
txtID0.MappingName = "caseid"
txtID0.HeaderText = "caseid"
txtID0.Width = 80
ts.GridColumnStyles.Add(txtID0)
Dim txtID As New DataGridTextBoxColumn()
txtID.MappingName = "MemberID"
txtID.HeaderText = "MemberID"
txtID.Width = 50
ts.GridColumnStyles.Add(txtID)
Dim txtID1 As New DataGridTextBoxColumn()
txtID1.MappingName = "Plan"
txtID1.HeaderText = "Plan"
txtID1.Width = 80
ts.GridColumnStyles.Add(txtID1)
Dim txtID2 As New DataGridTextBoxColumn()
txtID2.MappingName = "Retirement Date"
txtID2.HeaderText = "Retirement Date"
txtID2.Width = 80
ts.GridColumnStyles.Add(txtID2)
Dim txtID3 As New DataGridTextBoxColumn()
txtID3.MappingName = "CaseStatus"
txtID3.HeaderText = "CaseStatus"
txtID3.Width = 80
ts.GridColumnStyles.Add(txtID3)
Dim txtID4 As New DataGridTextBoxColumn()
txtID4.MappingName = "CaseDate"
txtID4.HeaderText = "CaseDate"
txtID4.Width = 80
ts.GridColumnStyles.Add(txtID4)
Dim txtID5 As New DataGridTextBoxColumn()
txtID5.MappingName = "Comments"
txtID5.HeaderText = "Comments"
txtID5.Width = 80
ts.GridColumnStyles.Add(txtID5)
dgCases.SetDataBinding(myDS, "MyTable")
dgCases.TableStyles.Clear() 'clear the contents for
second try.
dgCases.TableStyles.Add(ts)
dgCases.SetDataBinding(myDS, "MyTable")
dgCases.TableStyles(0).GridColumnStyles(1).Width = 0
End Function
Public Property MyBoolColumn() As Boolean
Get
Return m_MyBoolColumn
End Get
Set(ByVal Value As Boolean)
m_MyBoolColumn = Value
End Set
End Property
Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As
MouseEventArgs) Handles dgCases.MouseUp
Dim hti As DataGrid.HitTestInfo = Me.dgCases.HitTest(e.X, e.Y)
If hti.Column = 0 Then
dgCases.Item(hti.Row, hti.Column) = Not
CBool(dgCases.Item(hti.Row, hti.Column))
End If
End Sub