Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

selectindex always = 1 from datacombo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chris@oaksong.com - 31 Oct 2005 20:48 GMT
I give up. I've got a dropdowncombo. I'm trying to refer to the user
selection in the SelectedIndexChanged event. I select one of the last
items in the list. So far I have not been able to successfully access
either the text or the value using an index.

I've been plowing through deja.com to try and find a clue. The closest
I've gotten was someone mentioning in a September post that it didn't
work and you need to cast something. Sorry. I don't know anything about
fishing. I'm using VB for my code-behind.

Any suggestions including code snippets would be helpful.

My current, non-working code is....

       If cmbFirst.Items(cmbFirst.SelectedIndex).Value = True Then
           gg = cmbFirst.SelectedIndex
           setSub(cmbFirst.Items(cmbFirst.Selectedindex).Text(),
cbSub1)
       End If

TIA
Sreejith Ram - 31 Oct 2005 20:59 GMT
1) The Selected Value and text is available using
     cmbFirst.SelectedItem.Value & cmbFirst.SelectedItem.Text
2) One common mistake is, data binding on every post back. You may want to
make sure whether your data binding code is being called only the first time
page loaded.

code should be like below

if(!Page.IsPostBack())
{
  \\code to databind cmbFirst
}



> I give up. I've got a dropdowncombo. I'm trying to refer to the user
> selection in the SelectedIndexChanged event. I select one of the last
[quoted text clipped - 17 lines]
>
> TIA

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.