So I added the following event handler in my Web app, dropdown list to
add a blank item.

Protected Sub DD_jobno_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DD_jobno.DataBound, DD_jobno.DataBound
        DirectCast(sender, DropDownList).Items.Insert(0, String.Empty)
    End Sub

I'm not sure that this is the best method to use b/c I now have two
blank lines in my dropdown list.

Also, I have another event handler (on textchanged) for this same
dropdown list that if the value of the dropdown list is blank then to
enable my textbox (GLAcct) and if the value is not empty to disable my
textbox and gray it out.  This works fine if I select a value in my
dropdown list; however if I go back and select the blank item in my
dropdown list it does not re-enable my textbox.  I'm not sure what I'm
doing wrong.  Here is my code:

Protected Sub DD_jobno_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DD_jobno.TextChanged
        If DD_jobno.DataValueField = " " Then
            GLAcct.Enabled = True

        Else
            GLAcct.BackColor = Drawing.Color.Gray
            GLAcct.Enabled = False

        End If


    End Sub

On Oct 21, 1:21 pm, Glenn <[EMAIL PROTECTED]> wrote:
> Microsoft uses a lot of the same terminology in different controls.  In the
> future, make sure you specify what type of application you are working with:
> Web or Windows App.
>
> ...Glenn
>
>
>
> On Tue, Oct 21, 2008 at 1:38 PM, Imstac <[EMAIL PROTECTED]> wrote:
>
> > Sorry, I am brand new to VS and didn't realize that a dropdown control
> > is different from a dropdown list.  I just thought I wasn't looking in
> > the right place.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment

You may subscribe to group Feeds using a RSS Feed Reader to stay upto date 
using following url  

<a href="http://feeds.feedburner.com/DotNetDevelopment";> 
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---

Reply via email to