Focus in a dropdownlist

  • Thread starter Thread starter Gorka
  • Start date Start date
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??
 
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
 
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.
 
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)?
 
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.
 
Back
Top