473,378 Members | 1,412 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,378 software developers and data experts.

Event order handling

Hi all,

I have radio button list in a user control which when
selection changed fire an event which will modify the
current Thread culture.

This user control is on general page which contain one
dropdown list and typical calendar.

Clicking on the radio button did effectively modify the
calendar culture aspect, but not the dropdown (list
displayed depend on the culture)
Clicking another time make the change on the list but with
onr round-trip late.

When I look at the order the events are processed, my
selectedIndexChanged for the radio button list is the last
to be processed (seems normal as seen on MS site), which
explain previous behavior.

So my question is how to emulate the behavior of the
Calendar control, since the Load event for each control is
done first?
Thank you very much for your support
Xela

Nov 17 '05 #1
2 1442
Hi Xela,

I'm not really clear on your problem. Is it possible that you need to clear the
dropdownlist and then re-add the items in the appropriate culture? Perhaps you
could show us the code that isn't working?

At any rate, the code below seems to set the culture setting of the dropdown
list items.

Ken
MVP [ASP.NET]

Private Sub radFrench_CheckedChanged _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles radFrench.CheckedChanged
Dim ci As CultureInfo = _
New CultureInfo("fr-CA")
Thread.CurrentThread.CurrentCulture = ci
' Display the name of the culture
txtCulture.Text = Thread.CurrentThread. _
CurrentCulture.EnglishName
' Refresh the display of the data
With DropDownList1.Items
.Clear()
.Add("Display Name: " & ci.DisplayName)
.Add("English Name: " & ci.EnglishName)
.Add("Native Name: " & ci.NativeName)
' Get day names
.Add("Day Names:")
Dim strDayNames() As String = _
ci.DateTimeFormat.DayNames
Dim strDay As String
For Each strDay In strDayNames
.Add(" " & strDay)
Next
' Get the current year
.Add("Current year: " & ci.Calendar. _
GetYear(DateTime.Today))
' And the currency symbol
.Add("Currency symbol: " & _
ci.NumberFormat.CurrencySymbol)
End With
End Sub
--
Microsoft MVPs have a question for *you*: Are you patched against the Worm?
http://www.microsoft.com/security/se...s/ms03-026.asp

"Xela" <aj*******@hotmail.com> wrote in message
news:03****************************@phx.gbl...
Hi all,

I have radio button list in a user control which when
selection changed fire an event which will modify the
current Thread culture.

This user control is on general page which contain one
dropdown list and typical calendar.

Clicking on the radio button did effectively modify the
calendar culture aspect, but not the dropdown (list
displayed depend on the culture)
Clicking another time make the change on the list but with
onr round-trip late.

When I look at the order the events are processed, my
selectedIndexChanged for the radio button list is the last
to be processed (seems normal as seen on MS site), which
explain previous behavior.

So my question is how to emulate the behavior of the
Calendar control, since the Load event for each control is
done first?
Thank you very much for your support
Xela
Nov 17 '05 #2
I found a solution which solve the problem:
do not use the page_load of the user control, but use the
prerender event.

I do not know if it a fine solution, but it works.
It also allow me to understand a bit more the way asp.net
pages are processed.

Anyway thanks for your support.

Xela
-----Original Message-----
Hi Xela,

I'm not really clear on your problem. Is it possible that you need to clear thedropdownlist and then re-add the items in the appropriate culture? Perhaps youcould show us the code that isn't working?

At any rate, the code below seems to set the culture setting of the dropdownlist items.

Ken
MVP [ASP.NET]

Private Sub radFrench_CheckedChanged _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles radFrench.CheckedChanged
Dim ci As CultureInfo = _
New CultureInfo("fr-CA")
Thread.CurrentThread.CurrentCulture = ci
' Display the name of the culture
txtCulture.Text = Thread.CurrentThread. _
CurrentCulture.EnglishName
' Refresh the display of the data
With DropDownList1.Items
.Clear()
.Add("Display Name: " & ci.DisplayName)
.Add("English Name: " & ci.EnglishName)
.Add("Native Name: " & ci.NativeName)
' Get day names
.Add("Day Names:")
Dim strDayNames() As String = _
ci.DateTimeFormat.DayNames
Dim strDay As String
For Each strDay In strDayNames
.Add(" " & strDay)
Next
' Get the current year
.Add("Current year: " & ci.Calendar. _
GetYear(DateTime.Today))
' And the currency symbol
.Add("Currency symbol: " & _
ci.NumberFormat.CurrencySymbol)
End With
End Sub
--
Microsoft MVPs have a question for *you*: Are you patched against the Worm?http://www.microsoft.com/security/se...ulletins/ms03- 026.asp
"Xela" <aj*******@hotmail.com> wrote in message
news:03****************************@phx.gbl...
Hi all,

I have radio button list in a user control which when
selection changed fire an event which will modify the
current Thread culture.

This user control is on general page which contain one
dropdown list and typical calendar.

Clicking on the radio button did effectively modify the
calendar culture aspect, but not the dropdown (list
displayed depend on the culture)
Clicking another time make the change on the list but with
onr round-trip late.

When I look at the order the events are processed, my
selectedIndexChanged for the radio button list is the last
to be processed (seems normal as seen on MS site), which
explain previous behavior.

So my question is how to emulate the behavior of the
Calendar control, since the Load event for each control is
done first?
Thank you very much for your support
Xela
.

Nov 17 '05 #3

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

Similar topics

1
by: Paul E. Orman | last post by:
I have a piece of VB code (.NET 1.1 - VB 2003) that loads data from a database through a timer. So the timer is setup and from it I call the procedure that loads the latest records from the...
4
by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; ...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
5
by: Sergey Atun | last post by:
Hi, I inherited form and I writed it's load event: public class frmBase: System.Windows.Forms.Form { .... private void frmBase_Load(object sender, System.EventArgs e) { MessageBox.Show("this...
2
by: ZS | last post by:
Hi, On a form , I'm trying to trap when a shift key is pressed. Can someone explain how the KeyUp,KeyDown and Key Press event works for Forms. Thanks -ZS
9
by: Lloyd Sheen | last post by:
In an attempt to reformat the web page I moved controls into a frame and then when that did no good I replaced then on the aspx in the same order as before. When I did the CTL-X the handlers lost...
3
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
2
by: Paul E. Orman | last post by:
I have a piece of VB code (.NET 1.1 - VB 2003) that loads data from a database through a timer. So the timer is setup and from it I call the procedure that loads the latest records from the...
3
by: c676228 | last post by:
Hi all, I have an event in user control email to handling email change when user want to change the input for email address. Here it is In email.ascx.vb: Protected Sub UpdateEmail(ByVal sender As...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.