Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: DropDownList checked not set.


Message #1 by "Robert Sindall" <rsindall@z...> on Fri, 4 Oct 2002 12:50:21 +0100
Robert,

Here is code that I believe will work:

Dim i As Integer
For i = 0 To Country.Items.Count - 1
    If Country.Items(i).Value =_CustomerDetails.CountryID.ToString Then
        Country.SelectedItemIndex = i
    End If
Next

Hope this helps,

--Gene

-----Original Message-----
From: Robert Sindall [mailto:rsindall@z...]
Sent: Friday, October 04, 2002 4:50 AM
To: ASPX_Professional
Subject: [aspx_professional] DropDownList checked not set.


Hi

why isn't this setting the dropdown item to checked.

Country As System.Web.UI.WebControls.DropDownList
Value as ID column

Code:

                Dim i As Integer
                For i = 0 To Country.Items.Count - 1
                    If Country.Items(i).Value 
_CustomerDetails.CountryID.ToString Then
                        Country.Items(i).Selected = True
                    End If
                Next

Robert Sindall

Senior Developer
_______________________________

zethics
our technology is your business

www.zethics.com

e: rsindall@z...
v: +xx xxxx xxxxxx

____________________________________________________________

This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity
to which they are addressed. If you have received this email
in error please notify the system manager. Please note that
any views or opinions presented in this email are solely
those of the author and do not necessarily represent those
of the company. Finally, the recipient should check this
email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any
virus transmitted by this email.


---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces 
for developers who are already familiar with using ASP.NET. 
There is no trivial introductory material or useless .NET 
hype and the presentation of the namespaces, in an easy-to use 
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes, 
giving you those real-world tips that the documentation doesn't 
offer, and demonstrating complex techniques with simple 
examples.  

---

  Return to Index