473,325 Members | 2,771 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,325 software developers and data experts.

SelectedIndexChanged event in COmbobox s not working

15
I have a Combobox in an Application based on Windows Forms.
But though I change the index of items from the UI, the combobox internally doesn't fire the SelectedIndexChanged() event.
Does anybody has any solution ???
I used window.open() on LinkButtonClick to open the PDF in new window.
Apr 12 '12 #1

✓ answered by RhysW

instead of selectedindexchanged you could use the one just below it, selectedvaluechanged, reading the little explanations for each event makes it seem like the one i suggested is the event you are actually looking for

7 7200
RhysW
70
One mistake i make alot is creating the code and forgetting to hook it up to the event. In the event tab of the properties of the combobox make sure you set the event
'SelectedIndexChanged'
to actually execute the code you want it to do (should either be one of the dropdown choices or might need manual pointing to the code)
Apr 12 '12 #2
Intro
15
Hi RhysW,
For this I have already assigned the event to the combobox and written the SelectedIndexChanged(event e) in the code as well.

Have I an alternative to this combobox in WindowsForms so that we can overcome this problem ?
Apr 12 '12 #3
RhysW
70
Theres lots of alternatives, what exactly are you trying to do? use a selected combobox to open a pdf?

personally i would be tempted to take the route of the openFileDialog and allow the user to select the file they want to open by navigating through their files, something you could limit to being only pdf's using something similar to
Expand|Select|Wrap|Line Numbers
  1. openFileDialog1.Filter = "txt files (*.txt)|*.txt";
where the txt would be your pdf tag instead
its what users would expect to come across when wanting to open a file and with windows forms keeping to whats expected is always good for your users :P
i didn't go too indepth in code here because presumeably you already know how to open a pdf using file.io as that wasn't part of your question!
Apr 12 '12 #4
Intro
15
To be clear ,
1. I have a combobox.
2. If I change the selected value in that, I want the index value associated with the value(selected in combobox) to be populated in another textbox.
Apr 12 '12 #5
RhysW
70
instead of selectedindexchanged you could use the one just below it, selectedvaluechanged, reading the little explanations for each event makes it seem like the one i suggested is the event you are actually looking for
Apr 12 '12 #6
Intro
15
Yeah...Thank you RhysW
That worked for me..
Apr 19 '12 #7
adriancs
122 100+
Intro, you have to mark RhysW's answer as selected answer.
Apr 24 '12 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
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...
0
by: Robert Hanson | last post by:
I am trying to get the newly selected item in the dropdownlist control from the SelectedIndexChanged event. The event is working fine, but I am still getting the originally selected item in the...
1
by: Jack | last post by:
Hello, I have a dropdown list on a user control and the AutoPostBack property is set to True. I want to use the SelectedIndexChanged event to populate some text boxes based on what the user...
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...
3
by: Shawn | last post by:
I have a DataGrid with only one TemplateColumn wich contains a DropDownList. After I bind the DataGrid I fill the dropDownLists with values in ItemDataBound. None of the DropDownLists contains the...
11
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) { //...
6
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...
0
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...
5
by: GiJeet | last post by:
Hello, I'd like to force a call to the SelectedIndexChanged of a combo box from within a method. I tried to just call it like so: this.myComboBox.SelectedIndexChanged; but of course the event...
3
by: Audie7734 | last post by:
private void cboBowler_SelectedIndexChanged(object sender, System.EventArgs e) { string temp = cboBowler.Text; //calling methods creates a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.