dropdownlist

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2009
Posts: 54
Reputation: chriscross86 is an unknown quantity at this point 
Solved Threads: 0
chriscross86 chriscross86 is offline Offline
Junior Poster in Training

dropdownlist

 
0
  #1
Feb 19th, 2009
hi,
there...i need help.im not sure if my codes are appropriate..

  1. <asp'Label id:"lblreport" runat="server" text"type of report"></asp:Label>
  2. <asp:dropdownlist selected="true" value="annually"></asp:ListItem>
  3.  
  4. <asp:dropdownlist selected="true" value="Monthly"></asp:ListItem>
  5.  
  6. <asp:dropdownlist selected="true" value="weekly"></asp:ListItem>
  7.  
  8. <asp:dropdownlist selected="true" value="Daily"></asp:ListItem>
  9.  
  10. </asp:dropdownlist>
  11.  

im getting error telling 'cannot have multiple selection'.
Last edited by peter_budo; Feb 19th, 2009 at 4:08 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: dropdownlist

 
0
  #2
Feb 19th, 2009
As your error message suggests, you cannot have multiple items selected on a Dropdownlist. You can set only one ListItem's Selected property to true, which will be the default selected Item of your Dropdownlist. Your Dropdownlist should be something similar like this:
  1.  
  2. <asp:DropDownList ID="DropDownList1" runat="server">
  3. <asp:ListItem Selected="True">Anually</asp:ListItem>
  4. <asp:ListItem>Monthly</asp:ListItem>
  5. <asp:ListItem>Weekly</asp:ListItem>
  6. <asp:ListItem>Daily</asp:ListItem>
  7. </asp:DropDownList>
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 30
Reputation: sonakrish is an unknown quantity at this point 
Solved Threads: 1
sonakrish sonakrish is offline Offline
Light Poster

Re: dropdownlist

 
0
  #3
Feb 19th, 2009
Hi..
In dropdown u dont have multiple selection.
If u want to select multiple items use the list control and set selection mode property as multiple.
Hope it'll help u...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC