Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > making a dropdownlist visible when clicking in a textbox of a detailsview?

Reply
Thread Tools

making a dropdownlist visible when clicking in a textbox of a detailsview?

 
 
André
Guest
Posts: n/a
 
      06-19-2006
Hi,

I made a detailsview containing several fields for inserting only. I also
made a dropdownlist which is invisible at start.
Now, when clicking in a particular textbox, the dropdownlist must become
visible (in order to put the selected value of the dropdownlist into the
textbox of the detailsgrid.). I must say, the detailsview contains
textboxes, but also a checkbox.

I tried a lot of things, but i don't know which events to take:
<aspetailsView ID="DetailsView1" runat="server"
DataSourceID="SqlDataSource1
.....
<aspropDownList ID="DropDownList1" runat="server"
DataSourceID="SqlDataSource2"
.....
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
....
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
.....


In the code-behind, i tried thinks like:
Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetailsView1.DataBound
Dim a As DataControlField
a = DetailsView1.Fields(5)

if ??? then
dropdownlist1.visible=True
end if

End Sub

or
Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertEventAr gs) Handles
DetailsView1.ItemInserting
Dim a As New TextBox
a = DetailsView1.Rows(2)
if ??? then
dropdownlist1.visible=True
end if
End Sub

Can somebody tell me which event to take and how to check if the mouse is
clicked in the right textbox?
Thanks
André




 
Reply With Quote
 
 
 
 
bruce barker \(sqlwork.com\)
Guest
Posts: n/a
 
      06-19-2006
you must use client code for this (posting back on textbox focus so that
server side code coudl do it is not a good idea). this means you must render
the dropdown. use style commands to hide, not the visible property. then in
client onclick, change the style. pick up any book on javascript.

-- bruce (sqlwork.com)



"André" <(E-Mail Removed)> wrote in message
news:ugeUz%(E-Mail Removed)...
> Hi,
>
> I made a detailsview containing several fields for inserting only. I also
> made a dropdownlist which is invisible at start.
> Now, when clicking in a particular textbox, the dropdownlist must become
> visible (in order to put the selected value of the dropdownlist into the
> textbox of the detailsgrid.). I must say, the detailsview contains
> textboxes, but also a checkbox.
>
> I tried a lot of things, but i don't know which events to take:
> <aspetailsView ID="DetailsView1" runat="server"
> DataSourceID="SqlDataSource1
> ....
> <aspropDownList ID="DropDownList1" runat="server"
> DataSourceID="SqlDataSource2"
> ....
> <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ...
> <asp:SqlDataSource ID="SqlDataSource2" runat="server"
> ....
>
>
> In the code-behind, i tried thinks like:
> Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles DetailsView1.DataBound
> Dim a As DataControlField
> a = DetailsView1.Fields(5)
>
> if ??? then
> dropdownlist1.visible=True
> end if
>
> End Sub
>
> or
> Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e
> As
> System.Web.UI.WebControls.DetailsViewInsertEventAr gs) Handles
> DetailsView1.ItemInserting
> Dim a As New TextBox
> a = DetailsView1.Rows(2)
> if ??? then
> dropdownlist1.visible=True
> end if
> End Sub
>
> Can somebody tell me which event to take and how to check if the mouse is
> clicked in the right textbox?
> Thanks
> André
>
>
>
>



 
Reply With Quote
 
 
 
 
André
Guest
Posts: n/a
 
      06-20-2006
Ok thanks

"bruce barker (sqlwork.com)" <(E-Mail Removed)> wrote
in message news:%(E-Mail Removed)...
> you must use client code for this (posting back on textbox focus so that
> server side code coudl do it is not a good idea). this means you must

render
> the dropdown. use style commands to hide, not the visible property. then

in
> client onclick, change the style. pick up any book on javascript.
>
> -- bruce (sqlwork.com)
>
>
>
> "André" <(E-Mail Removed)> wrote in message
> news:ugeUz%(E-Mail Removed)...
> > Hi,
> >
> > I made a detailsview containing several fields for inserting only. I

also
> > made a dropdownlist which is invisible at start.
> > Now, when clicking in a particular textbox, the dropdownlist must become
> > visible (in order to put the selected value of the dropdownlist into the
> > textbox of the detailsgrid.). I must say, the detailsview contains
> > textboxes, but also a checkbox.
> >
> > I tried a lot of things, but i don't know which events to take:
> > <aspetailsView ID="DetailsView1" runat="server"
> > DataSourceID="SqlDataSource1
> > ....
> > <aspropDownList ID="DropDownList1" runat="server"
> > DataSourceID="SqlDataSource2"
> > ....
> > <asp:SqlDataSource ID="SqlDataSource1" runat="server"
> > ...
> > <asp:SqlDataSource ID="SqlDataSource2" runat="server"
> > ....
> >
> >
> > In the code-behind, i tried thinks like:
> > Protected Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As
> > System.EventArgs) Handles DetailsView1.DataBound
> > Dim a As DataControlField
> > a = DetailsView1.Fields(5)
> >
> > if ??? then
> > dropdownlist1.visible=True
> > end if
> >
> > End Sub
> >
> > or
> > Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e
> > As
> > System.Web.UI.WebControls.DetailsViewInsertEventAr gs) Handles
> > DetailsView1.ItemInserting
> > Dim a As New TextBox
> > a = DetailsView1.Rows(2)
> > if ??? then
> > dropdownlist1.visible=True
> > end if
> > End Sub
> >
> > Can somebody tell me which event to take and how to check if the mouse

is
> > clicked in the right textbox?
> > Thanks
> > André
> >
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide textbox / Make textbox not visible (NOT USING visible property) Jurjen de Groot ASP .Net Web Controls 0 05-19-2008 09:50 AM
RE: Issue making textbox visible based on specific input from a radio Dan ASP .Net 0 12-01-2006 10:05 PM
Issue making textbox visible based on specific input from a radio button list in an EditItemTemplate Dan ASP .Net 0 11-30-2006 11:03 PM
making a dropdownlist visible when clicking in a textbox of a detailsview? André ASP .Net 2 06-20-2006 11:36 AM
I want to be able to access the internet by opening my browser and not right clicking and then clicking connect. James Johnson Computer Support 1 05-15-2004 03:40 AM



Advertisments