473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

TextBox and Postion Changed

Hey Group,

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
Nov 21 '05 #1
6 1200
Simon,

In the code is not the lstDocumentSelected Index changed.
That is a part you have to add with the right path in it, almost the same as
the other selected indexes changes.

However instead of filling the rowfilter there you place the path to your
documentfolder.

I could not test that so I kept that open.

Cor

Hey Group,

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

Nov 21 '05 #2
Sorry Cor,

I feel stupid now but im confused again:(

I guess I need to add something like:

Private Sub lstDocuments_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lstDocuments.SelectedIndexChanged
If mlLoading = False Then
IN HERE - MAYBE GOES THE BINDING CONTEXT? << End If
End Sub

or am I totally not understanding this right?

Cheers and Many Thanks
MCN

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:e$**************@TK2MSFTNGP10.phx.gbl...
Simon,

In the code is not the lstDocumentSelected Index changed.
That is a part you have to add with the right path in it, almost the same as the other selected indexes changes.

However instead of filling the rowfilter there you place the path to your
documentfolder.

I could not test that so I kept that open.

Cor

Hey Group,

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


Nov 21 '05 #3
Simon,

I thought this row than
Me.txtFileLocation.Text = Me.lstDocuments.SelectedValue.ToString

Cor
Nov 21 '05 #4
Hi Cor,

Thanks thats the one, just one thing tho, how do I get my textbox to be
Blank until I click on a document?

On the below, its displaying the last shown path of the last clicked on
document untill I click on the next docuemnt then it shows that so on and so
one, if ya get my meaning?

Cheers
MCN

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Simon,

I thought this row than
Me.txtFileLocation.Text = Me.lstDocuments.SelectedValue.ToString

Cor

Nov 21 '05 #5
Simon,

When you want you can set in every index change event
Me.txtFileLocation.text = ""

Cor
Nov 21 '05 #6
Cor,

Your a Start that is aboslutly spot on:)

Cheers
MCN

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
Simon,

When you want you can set in every index change event
Me.txtFileLocation.text = ""

Cor

Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: TN Bella | last post by:
Hello, I was looking through the older posts for a solution to this problem, but I am still confused on how to fix my problem. There are two dates on my form, one (txtInvDate) is entered by the...
6
by: kurt | last post by:
Hi all, I have something that has me stumped. I have a webform that has several text boxes. Each of these boxes has the textchanged set so when the user enters text and leaves the textbox, it...
2
by: Harry Hudini | last post by:
I have a multiline textbox and want to be able to allow the user to position the cursor in a line of the textbox, then click on a Remove button to remove the line which the cursor is on. Thing is,...
6
by: JohnR | last post by:
I have a table with 1 row which is used to hold some application wide items (one item per field, hence I only need 1 row). I want to bind one of the fields to a textbox. After setting up the...
4
by: PJ6 | last post by:
What's the best way to prevent the tab key from shifting focus away from a textbox, but rather insert the tab character? Do I just do it the obvious way with JavaScript or is there some simple...
1
by: lg | last post by:
Is there a way to set/get vertical scroll postion without Javascript. At times I need to repaint the page but the page should scroll to certain postion depending on user input.
3
by: sungung | last post by:
Hi group, I want to back orginal scroll postion after reload page. Is it possible? My situation is call popup windows -enter data on popup -close popup -refresh parent page -reload data. As...
2
by: jd | last post by:
I have several textboxes in which the end user can enter values. When the user presses the Enter key when in any of the textboxes, or leaves that textbox, I want a routine to run (mathematical...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.