473,671 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comboxbox's SelectedIndexCh anged event not functioning

I have a popup window, which consist of 2 combobox. The second
combobox's(cboC ube) item collection will change based on the first
combobox's(cboD atabase) event(selectedi ndex_changed) is fired. And, I do have
write such code in code-behind as follow:

Private Sub cboDatabase_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboDatabase.Sel ectedIndexChang ed
Dim strAdomdConnect ionString As String

Try
With mdtsAnalysisDB. Tables(0).Rows( cboDatabase.Sel ectedIndex)
strAdomdConnect ionString =
BuildAdomdConne ctionString(CSt r(.Item("Server Name")),
CStr(.Item("Ana lysisDBName")), CStr(.Item("Use rName")),
CStr(.Item("Pas sword")))
End With

FillCubeCombox( strAdomdConnect ionString)

Catch ex As Exception
Throw New ApplicationExce ption(ex.Messag e.ToString)
End Try
End Sub

Private Sub FillCubeCombox( ByVal pstrAdomdConnec tionString As String)
Dim adomdConn As AdomdConnection
Dim cube As CubeDef

Try
adomdConn = New AdomdConnection (pstrAdomdConne ctionString)
adomdConn.Open( )

cboCube.Items.C lear()

For Each cube In adomdConn.Cubes
cboCube.Items.A dd(cube.Caption )
Next

Catch ex As Exception
Throw New ApplicationExce ption(ex.Messag e.ToString)
End Try
End Sub

But, why my second combobox's(cboC ube) item collection won't change, when my
first combobox's(cboD atabase) selectedindex is changed? Besides, I also set
the first combobox's property(AutoPo stBack) to true.

Please help... Thanks.

FYI, the following is my Page_Load code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim strAdomdConnect ionString As String

Try
If Not Me.IsPostBack Then
Me.btnOK.Attrib utes.Add("oncli ck", "Done('" &
txtConnectionSt ring.Text & "');")

FillDatabaseCom bobox()

With mdtsAnalysisDB. Tables(0).Rows( cboDatabase.Sel ectedIndex)
strAdomdConnect ionString =
BuildAdomdConne ctionString(CSt r(.Item("Server Name")),
CStr(.Item("Ana lysisDBName")), CStr(.Item("Use rName")),
CStr(.Item("Pas sword")))
End With

FillCubeCombox( strAdomdConnect ionString)
End If

Catch ex As Exception
Throw New ApplicationExce ption(ex.Messag e.ToString)
End Try
End Sub

Nov 19 '05 #1
0 981

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

Similar topics

3
7994
by: sandman | last post by:
I've got a combo box that has an event handler set for SelectedIndexChanged event. The problem is that it's firing at startup when I load data from the Form_OnLoad event. I tried setting a flag at startup and turning it off at the end of the OnLoad function but the SelectedIndexChange event gets called after OnLoad finishes, so my flag is off. How can I get around this? Is there another event that I can use to turn the flag off? Or...
0
5417
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this board. I have a form that contains a ListView and a GroupBox control. The GroupBox control itself contains several TextBox Controls. I have Validating and Validated event handlers set for the GroupBox control, and a SelectedIndexChanged event...
0
1742
by: tafpin | last post by:
I have an application with a datagrid. In the IDE I have 2 template columns. The first has an image button and the second contains a link button. According to the results that I get back I must add more columns to the datagrid. This is a sample of how I am adding these colums: templateColumn = New TemplateColumn
3
2626
by: Alec MacLean | last post by:
Hi, I have a couple of win forms where I am editing values that are stored in a SQL database. I'm using the listbox control to hold the data object each form interacts with. Each object is defined by my own classes. On the first form, I use an approach to reduce the number of database calls. This essentially consists of :
2
3295
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some details first. The DropDownList is actually a custom control called DropDownListWithCommandEvent that inherits from DropDownList. The reason I have created this is to create a DropDownList that will bubble a Command event to the containing...
11
36974
by: J055 | last post by:
Hi I have a dropdown control which is constructed in another dropdown control SelectedIndexChanged event protected void ddlParamType_SelectedIndexChanged(object sender, EventArgs e) { // some other code DropDownList ddlGroups = new DropDownList(); ddlGroups.SelectedIndexChanged += new
6
10809
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I modify the Items collection to be {two,one,three} and now want "two" to appear in the combobox text. However, the combobox text is now blank. the is apparently somehow the result of having changed the combobox.Items collection. If, trying to fix...
4
5247
by: lakepeir | last post by:
Hello, I have combobox with a selectedindexchanged method that seems to be called when starting the application, launching the form with the combobox and making a change in the drop down box of the combobox. Can anyone tell me why the method is called so often? I would only like the method executed when a user makes a change in the drop down box. Am I using the incorrect method. Thanks.
0
2008
by: BillCo | last post by:
I'm a C# Newbie, so if I've missed the obvious here go easy!!! I have a form opened from a MDI parent. The form has a data bound combo box, with a SelectedIndexChanged event (fills a list view box on the same form depending on selection). It all works fine except when you close either the form itself or it's MDI parent. Somehow as the form is closing this event is triggered, and crashes out with an un- handled error (even though it's in...
0
8912
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8597
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.