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

selectedIndexChanged

How can I run dropdownlist_SelectedIndexChanged event on form load?

Thanks
Nov 15 '05 #1
5 8013
Meybe try:
dropDownList.SelectetIndex = 0 //set on first field id dropdownlist
Użytkownik "Selen" <sk*****@yahoo.com> napisał w wiadomo¶ci
news:OL*************@TK2MSFTNGP11.phx.gbl...
How can I run dropdownlist_SelectedIndexChanged event on form load?

Thanks

Nov 15 '05 #2
Hi

I had this problem so try this try adding a please select entry to the
DropDownList. I found that if the user selected the first entry in the ddl
it obviously nver called the SelectIndexChanged event

Client

private void AvailableClasses_SelectedIndexChanged(object sender,
System.EventArgs e)

{

//Do Something
}

"Selen" <sk*****@yahoo.com> wrote in message
news:OL*************@TK2MSFTNGP11.phx.gbl...
How can I run dropdownlist_SelectedIndexChanged event on form load?

Thanks

Nov 15 '05 #3
LOL sorry I sent it before I had finished damn numb fingers

I had this problem so try this try adding a please select entry to the
DropDownList. I found that if the user selected the first entry in the ddl
it obviously nver called the SelectIndexChanged event

Client Side
<TD vAlign="middle" align="left" width="50%">
<asp:dropdownlist id="AvailableClasses" runat="server" Width="200px"
AutoPostBack="True">
<asp:ListItem Value="Please Select">Please Select</asp:ListItem>
</asp:dropdownlist>
</TD>
Server Side
private void AvailableClasses_SelectedIndexChanged(object sender,
System.EventArgs e)

{

//Do Something
}

"Selen" <sk*****@yahoo.com> wrote in message
news:OL*************@TK2MSFTNGP11.phx.gbl...
How can I run dropdownlist_SelectedIndexChanged event on form load?

Thanks

Nov 15 '05 #4
Hi Selen
How can I run dropdownlist_SelectedIndexChanged event on form load?


There is a good practise to write a method that will handle whole
work for event/events.
So you can write your own method e.g.:

private void DropDownListSelectedIndexChangedWork() {
// your code here
}

so you can call this method in *SelectedIndexChanged* handle:

private void dropdownlist_SelectedIndexChanged(object sender
, EventArgs e) {
this.DropDownListSelectedIndexChangedWork();
}

Regards

Marcin
Nov 15 '05 #5
Marcin Grzębski wrote:
Hi Selen
How can I run dropdownlist_SelectedIndexChanged event on form load?

There is a good practise to write a method that will handle whole
work for event/events.
So you can write your own method e.g.:

private void DropDownListSelectedIndexChangedWork() {
// your code here
}

so you can call this method in *SelectedIndexChanged* handle:

private void dropdownlist_SelectedIndexChanged(object sender
, EventArgs e) {
this.DropDownListSelectedIndexChangedWork();
}


I forgot...
And then you can call *DropDownListSelectedIndexChangedWork* method
in form *Load* event handle.

Marcin
Nov 15 '05 #6

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

Similar topics

0
by: LV | last post by:
Hello, I would like to manually set one of my list view items as selected. When this item is set, I would like for a method to execute. I have a delegate on the list view for SelectedIndexChanged....
0
by: LV | last post by:
Hello, When I manually set a list view item to be a selected item, the SelectedIndexChanged event is not firing. Am I missing something here? using System; using System.Windows.Forms; ...
1
by: Donal | last post by:
I have 3 related dropdowns. When the 1st is changed, the 2nd is updated, and when the 2nd is changed, the 3rd is updated. When i change the 1st dropdown (sites), the SelectedIndexChanged fires...
0
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...
0
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...
2
by: rdb | last post by:
VB.NET web program with a webform w/2 dropdownlistboxes, set to AutoPostBack TRUE, selection in either dropdown fires the SelectedIndexChanged events correctly UNTIL I navigate to second webform in...
7
by: sparkle | last post by:
Hi Everybody, I'm filling a combobox from a class, which works fine on it's own. But when I insert code to fill in other controls something in the combobox fill is causing the...
3
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...
3
by: martin1 | last post by:
Hi, All, I want user select first item (called All) in listbox, then all other items are selected by SetSelected method, but in loop (see code below) whenever going to SetSelected(), the...
4
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
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...
0
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,...
0
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...

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.