Hi...
I'm a newbie with asp.NET and this problem really
bugs me out...
I have a web form with some dropdownlists (DDL). In the
page load, only one DDL is bind. Then, according to the
selection that the user makes from the first DDL, all of
the other DDL are binded in the SelectedIndexCh ange
method of the first DDL (autopostback value is set to
TRUE). When I run my web form, the first selection bind
the other DDL correctly but then I lose all the event
that are associated with my web controls (Ex : no action
is done when I select another item from the first DDL,
and no button have action neither...)I found out that it
seems to be the number of Dropdownlists that I bind that
cause the problem...
In fact, if I put anyone of the 3 InitializeDDL in
comments,
everything works just fine, but with all of them, I lose
the event-association with my webform...
I really hope that someone can help me with this one
cause I just don't get it!
Thanks a lot
Ben
Here's a sample of my code
*************** *************** *************** *********
Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
If Not Page.IsPostBack Then
InitializeDDL1( )
End If
End Sub
Private Function InitializeDDL1( )
Dim sql As String = "SELECT Name, PlaneId FROM
[...]"
Dim cmd As New SqlCommand(sql, Con.cn)
DDL1.DataSource = Con.GetDataSet( cmd)
DDL1.DataTextFi eld = "Name"
DDL1.DataValueF ield = "PlaneId"
DDL1.DataBind()
DDL1.Items.Inse rt(0, "")
End Function
Private Sub DDL1_SelectedIn dexChanged(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
DDLVol.Selected IndexChanged
If Not DDL1.SelectedIn dex = -1 And Not DDL1.SelectedIn dex
= 0 Then
Dim VolSel As New Vol(DDL1.Select edItem.Value)
' **** I have to put out one of them to make it work
InitializeLB1()
InitializeDDL2( )
InitializeDDL3( )
InitializeDDL4( )
[...]
End Sub
' *** Another way to bind a DDL
Private Sub InitializeDDL3( )
Dim Array1() As Escales
Dim i As Integer
Dim VolSel As New Vol(DDL1.Select edItem.Value)
Array1 = VolSel.GetEscal es
For i = 0 To UBound(Escale) - 2
DDL3.Items.Inse rt(i, Array1(i).Name)
Next
DDL3.Items.Inse rt(0, "")
End Sub
*************** *************** *************** **********
.. 0 895 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kelmen Wong |
last post by:
Greeting,
I'm working on a routine that dynamically locate a html/web control
using FindControl(), then perform some manipulation like bind a
datatable onto the control.DataSource.
switch(objCtrl.GetType().Name)
{
case "HtmlSelect":
HtmlSelect objHtmlSelect = (HtmlSelect)objCtrl;
|
by: Simon Barbour |
last post by:
Hi all,
Tearing my hair out on this one so hopefully somebody can help.
I have written a custom control to represent a button on a touchscreen EPoS
(electronic point of sale) peice of hardware. As part of my control I have
a property declared like so:
private byte posForeColor;
/// <summary>
|
by: David Batt |
last post by:
Hello,
I'm using a custom control called datetimeslicker which inherits from the datetimepicker contro
and it allows you to bind null values to datetimepickers, the code for this is attached
However I'm binding such a control (dtsFixedDate) to a class property Fixeddat
The binding is performed as follow
Public Sub BindDateTimeSlickerField(ByVal strBoundfield As String, ByRef MyBoundSource As Object, ByVal strBoundTo As String, ByRef...
|
by: funkyMonkey |
last post by:
I'm binding date fields from entity objects and formatting the output in the
text box in short date format.
Code:
BindDateField(Me.txtCheckIn, "Text", reservation.BookingDetail, "CheckIn")
BindDateField(Me.txtCustTravleDate, "Text", reservation.BookingDetail,
"CheckIn")
BindDateField(Me.txtCheckOut, "Text", reservation.BookingDetail, "CheckOut")
|
by: AMDRIT |
last post by:
Hello everyone,
VB2003-Winforms
I have a class object (testclass), that I would like to bind parts of to two
custom controls (control1 and control2). The testclass is stored in a hash
table for the life of the client session. Upon first run (Creation of
testclass), the bindings work fine and everyone is happy. However, if I
were to open the testclass again, and bind to my controls again, the
underlying controls (i.e. textboxes)...
| |
by: John J. Hughes II |
last post by:
I have a DataGridView displaying data from a DataSet. To the right of that
I have a custom user control which displays one of the data set fields.
The custom user control is bound to the data set object and displays the
data correctly when I move from row to row.
The problem I am having is the data set always reads the data back and
considers it change even when it's not. I am looking for how to change the
following code so the...
|
by: TC |
last post by:
I'm using Visual Studio 2005 with SourceGear Vault. I'm having trouble
with the integrated source code control features. I think the problem
is entirely with Visual Studio, not Vault.
First, let me say that I think the integrated source control features
are wonderful. They work great, except when they don't work at all.
Unfortunately, they don't work every time I need them, so I've had to
turn them off completely.
The trouble is with...
|
by: Rolf Welskes |
last post by:
Hello,
I have an ObjectDataSource which has as business-object a simple array of
strings. No problem.
I have an own (custom) control to which I give the DataSourceId and in the
custom-control so I get the ObjectDataSource. No problem
.....
ObjectDataSource src = .... //is ok i have it
|
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= |
last post by:
Hello,
I have a custom control (not a listbox or other hierarchical or list
control) that I would like to bind to a specific row and column from a
DataTable.
Each row of the datatable will have columns like PropertyName, IsEnabled,
CurrentValue, etc.
In my control, I want to show the CurrentValue of a property with a
|
by: Andrus |
last post by:
Winforms appl creates customer edit form containing textboxes using
Customer dataSource = Northwind.Customers.GetByName("Airbus");
MaskedTextBox tb = new MaskedTextBox();
Binding binding = new Binding("Text", dataSource, "Phone");
binding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged;
binding.FormattingEnabled = true;
tb.DataBindings.Add(binding);
There is revert button in form which discards edited fields read original
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |