Focus in a dropdownlist

G

Gorka

Hi,

I've done a function to put the focus in a dropdownlist and I've realise
that I have to click two times to display the items.

Do anyone know why??
 
G

Guest

Hi,

I've done a function to put the focus in a dropdownlist and I've realise
that I have to click two times to display the items.

Do anyone know why??

because of the coding I guess

Check where do you bind your data. It looks like you don't bind the
dropdownlist on Page_Load
 
G

Gorka

I think yes. The dropdownlist is binded on the page load, I say, before I
click the dropdownlist the dropdownlist is full of listitems.

Thanks for all.
 
G

Guest

I think yes. The dropdownlist is binded on the page load, I say, before I
click the dropdownlist the dropdownlist is full of listitems.

you said you have to click two times to display the items.

Can you post here the code (for the dropdown and actions related to
it)?
 
G

Gorka

Ok,

I'm working in VS2005. And I'm using Atlas.

The dropdownlist is binded directly to a ObjectDataSource, this is binded to
a Entity than takes data from de DataBase.

And the General Function that I use to write the javascrit functions in all
the controls is:

Private Function SetOnOFControl(ByRef objLinea As Object, ByVal
nombreControl As String, _

Optional ByVal estilo As String = "etiquetaValue", Optional ByVal estiloSel
As String = "etiquetaValueSel") As Boolean

Try

CType(objLinea.FindControl(nombreControl), Object).CssClass = estilo

CType(objLinea.FindControl(nombreControl),
Object).Attributes.Add("onfocus", "this.className='" & estiloSel & "'")

CType(objLinea.FindControl(nombreControl),
Object).Attributes.Add("onblur", "this.className='" & estilo & "'")

Return True

Catch ex As Exception

Return False

End Try

End Function

Private Function SetOnOfControlesGV(ByRef gvRow As GridViewRow) As Boolean

flagresp = SetOnOFControl(gvRow, "ddlGrupo")

Return True

End Function

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top