I have the following code listed below:
On my Winform I have 3 List Box`s and a Text Box. When I click on Catagories
on my first ListBox it lists the Sub Catagories for that in the Second, when
I click on a Sub Catagorie, it lists all my Documents for that in the Third
List box.
My Text Box Lists the Patch of the Document which I get from my Database.
However ......... My Textbox dosn`t refresh, i mean as in, when i click on
any document, in any sub catagorie the textbox only lists the first one i
clicked on:(
I was think i may need something similar to Selected_IndexChange but i don`t
quite know what.
Any help much appriciated.
Many Thanks
Regards
Si
>>>>>>CODE<<<<<<<<<<<<<
Dim dvCatagory As DataView
Dim dvDocuments As DataView
Private Sub frmTechDocs_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
odcTechDocs.ConnectionString = Connection.String
mlLoading = True
'Start of Fill Datasets
Try
dsTechDocs.EnforceConstraints = False
Try
Me.odcTechDocs.Open()
'Fill Documents Datasets
Me.odaCatagories.Fill(dsTechDocs)
Me.odaSubDocuments.Fill(dsTechDocs)
Me.odaDocuments.Fill(dsTechDocs)
Me.lstCatagories.DataSource = dsTechDocs.DocumentCatagories
Me.lstCatagories.DisplayMember = "DocumentCatagories"
Me.lstCatagories.ValueMember = "DocumentCatagoriesID"
dvCatagory = New DataView(dsTechDocs.DocumentSubCategories)
Me.lstSubCatagories.DataSource = dvCatagory
Me.lstSubCatagories.DisplayMember = "DocumentSubCatagories"
Me.lstSubCatagories.ValueMember = "DocumentSubCatagoriesID"
' dvCatagory.RowFilter = "DocumentCatagories = ' '"
dvDocuments = New DataView(dsTechDocs.Documents)
Me.lstDocuments.DataSource = dvDocuments
Me.lstDocuments.DisplayMember = "DocumentName"
Me.lstDocuments.ValueMember = "DocumentLocation"
dvDocuments.RowFilter = "DocumentSubCatagories = ' '"
Catch fillException As System.Exception
Throw fillException
Finally
'To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
'dsDocuments.EnforceConstraints = True
Me.odcTechDocs.Close()
End Try
Catch eLoad As System.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message )
Finally
mlLoading = False
End Try
'End of Fill Datasets
End Sub
Private Sub lstCatagories_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
lstCatagories.SelectedIndexChanged
If mlLoading = False Then
Dim a As String = lstCatagories.SelectedValue.ToString
Dim b As String = dvCatagory(0)("DocumentCatagories").ToString
dvCatagory.RowFilter = "DocumentCatagories = '" &
lstCatagories.SelectedValue.ToString & "'"
End If
End Sub
Private Sub lstSubCatagories_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
lstSubCatagories.SelectedIndexChanged
If mlLoading = False Then
dvDocuments.RowFilter = "DocumentSubCatagories = '" &
lstSubCatagories.SelectedValue.ToString & "'"
End If
End Sub