Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > FormView DropdownList - On Selection Change populate Text Box

Reply
Thread Tools

FormView DropdownList - On Selection Change populate Text Box

 
 
Satish
Guest
Posts: n/a
 
      03-28-2008
C#, ASP.NET
Q: Have a formview, with a dropdownlist which is bound to a column. This
dropdownlist has a datasource of DataSet type. Now my objective is, on
Selection Changed of this DropdownList, I need to populate a couple of
TextBox's. How can I do this? What event does the code go into? The
selectionindexchanged even for the DropDownList does not seem to fire.

Any help is appreciated.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Just Me
Guest
Posts: n/a
 
      03-28-2008
The selectIndexChanged event absolutely should fire. However, if you are
expecting it to cause a postback when you change the selection, you need to
set the AutoPostback property= true in the properties for this control.

Once you have got the event fireing its jsut a matter of writing your code
based on the selected index data.

HTH




"Satish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> C#, ASP.NET
> Q: Have a formview, with a dropdownlist which is bound to a column. This
> dropdownlist has a datasource of DataSet type. Now my objective is, on
> Selection Changed of this DropdownList, I need to populate a couple of
> TextBox's. How can I do this? What event does the code go into? The
> selectionindexchanged even for the DropDownList does not seem to fire.
>
> Any help is appreciated.
>
> Thanks in advance.
>



 
Reply With Quote
 
 
 
 
Satish
Guest
Posts: n/a
 
      03-28-2008
Nope, tried adding code in SelectionIndexChanged Event and even tried with
the Debugger, nothing.

"Satish" wrote:

> C#, ASP.NET
> Q: Have a formview, with a dropdownlist which is bound to a column. This
> dropdownlist has a datasource of DataSet type. Now my objective is, on
> Selection Changed of this DropdownList, I need to populate a couple of
> TextBox's. How can I do this? What event does the code go into? The
> selectionindexchanged even for the DropDownList does not seem to fire.
>
> Any help is appreciated.
>
> Thanks in advance.
>

 
Reply With Quote
 
Just Me
Guest
Posts: n/a
 
      03-28-2008

Does your page_load event fire ?, if not, check that your Autowireup event
is set to true. Also, you didnt comment on the Autopostback I mentioned have
you checked this.

Whatever you problem is, its likely to be very basic.



"Satish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Nope, tried adding code in SelectionIndexChanged Event and even tried with
> the Debugger, nothing.
>
> "Satish" wrote:
>
>> C#, ASP.NET
>> Q: Have a formview, with a dropdownlist which is bound to a column. This
>> dropdownlist has a datasource of DataSet type. Now my objective is, on
>> Selection Changed of this DropdownList, I need to populate a couple of
>> TextBox's. How can I do this? What event does the code go into? The
>> selectionindexchanged even for the DropDownList does not seem to fire.
>>
>> Any help is appreciated.
>>
>> Thanks in advance.
>>



 
Reply With Quote
 
Just Me
Guest
Posts: n/a
 
      03-28-2008
Should read "Autowireup" @page property


"Just Me" <news.microsoft.com> wrote in message
news:(E-Mail Removed)...
>
> Does your page_load event fire ?, if not, check that your Autowireup event
> is set to true. Also, you didnt comment on the Autopostback I mentioned
> have you checked this.
>
> Whatever you problem is, its likely to be very basic.
>
>
>
> "Satish" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Nope, tried adding code in SelectionIndexChanged Event and even tried
>> with
>> the Debugger, nothing.
>>
>> "Satish" wrote:
>>
>>> C#, ASP.NET
>>> Q: Have a formview, with a dropdownlist which is bound to a column. This
>>> dropdownlist has a datasource of DataSet type. Now my objective is, on
>>> Selection Changed of this DropdownList, I need to populate a couple of
>>> TextBox's. How can I do this? What event does the code go into? The
>>> selectionindexchanged even for the DropDownList does not seem to fire.
>>>
>>> Any help is appreciated.
>>>
>>> Thanks in advance.
>>>

>
>



 
Reply With Quote
 
Stan
Guest
Posts: n/a
 
      03-29-2008
On 28 Mar, 20:50, "Just Me" <news.microsoft.com> wrote:
> The selectIndexChanged event absolutely should fire. However, if you are
> expecting it to cause a postback when you change the selection, you need to
> set the AutoPostback property= true in the properties for this control.
>
> Once you have got the event fireing its jsut a matter of writing your code
> based on the selected index data.
>
> HTH
>
> "Satish" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > C#, ASP.NET
> > Q: Have a formview, with a dropdownlist which is bound to a column. This
> > dropdownlist has a datasource of DataSet type. Now my objective is, on
> > Selection Changed of this DropdownList, I need to populate a couple of
> > TextBox's. How can I do this? What event does the code go into? The
> > selectionindexchanged even for the DropDownList does not seem to fire.

>
> > Any help is appreciated.

>
> > Thanks in advance.- Hide quoted text -

>
> - Show quoted text -


Unfortunately, even when AutoPostback is enabled on a drop-downlist it
won't trigger a postback unless the selected value is *different* from
the previous one (or unless the SelectedIndex property actually
changes). Merely clicking on it will not do the trick.

This exposes a fundamental problem with Satish's design. Since the DDL
is preloaded with data it will not necessarily work in the intended
fashion. The best approach is to preload the other controls with
relevent data (based on the initial selection) during the FormView
DataBound event.
 
Reply With Quote
 
Just Me
Guest
Posts: n/a
 
      03-29-2008
With respect, I think you have missed the point. See my comments in
stars.***

>> The selectIndexChanged event absolutely should fire. However, if you are
>> expecting it to cause a postback when you **** change the selection ****
>> , you need to



"Stan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On 28 Mar, 20:50, "Just Me" <news.microsoft.com> wrote:
>> The selectIndexChanged event absolutely should fire. However, if you are
>> expecting it to cause a postback when you change the selection, you need
>> to
>> set the AutoPostback property= true in the properties for this control.
>>
>> Once you have got the event fireing its jsut a matter of writing your
>> code
>> based on the selected index data.
>>
>> HTH
>>
>> "Satish" <(E-Mail Removed)> wrote in message
>>
>> news:(E-Mail Removed)...
>>
>>
>>
>> > C#, ASP.NET
>> > Q: Have a formview, with a dropdownlist which is bound to a column.
>> > This
>> > dropdownlist has a datasource of DataSet type. Now my objective is, on
>> > Selection Changed of this DropdownList, I need to populate a couple of
>> > TextBox's. How can I do this? What event does the code go into? The
>> > selectionindexchanged even for the DropDownList does not seem to fire.

>>
>> > Any help is appreciated.

>>
>> > Thanks in advance.- Hide quoted text -

>>
>> - Show quoted text -

>
> Unfortunately, even when AutoPostback is enabled on a drop-downlist it
> won't trigger a postback unless the selected value is *different* from
> the previous one (or unless the SelectedIndex property actually
> changes). Merely clicking on it will not do the trick.
>
> This exposes a fundamental problem with Satish's design. Since the DDL
> is preloaded with data it will not necessarily work in the intended
> fashion. The best approach is to preload the other controls with
> relevent data (based on the initial selection) during the FormView
> DataBound event.



 
Reply With Quote
 
claritymedispa@gmail.com
Guest
Posts: n/a
 
      03-29-2008
On Mar 28, 3:44*pm, Satish <(E-Mail Removed)> wrote:
> C#, ASP.NET
> Q: Have a formview, with a dropdownlist which is bound to a column. This
> dropdownlist has a datasource of DataSet type. Now my objective is, on
> Selection Changed of this DropdownList, I need to populate a couple of
> TextBox's. How can I do this? What event does the code go into? The
> selectionindexchanged even for the DropDownList does not seem to fire.
>
> Any help is appreciated.
>
> Thanks in advance.


why not use javascipt?
if you have element, for example, like this:
<select id="selectDriveList"
onchange="change_drive(this.options[this.selectedIndex].value);">
<option .....>
<option ....>
</select>

then javascript:
<script>
function change_drive( drive_letter )
{
document.getElementById("textTextBox1").value ="user selected " +
drive_letter;
}
</script>

no?


... more at http://www.siccolo.com/articles.asp
 
Reply With Quote
 
Satish
Guest
Posts: n/a
 
      03-31-2008
Page load fires, regardless of Postback - true/false.

However, the selectionindexchanged event just does not fire.
I read thru the AutoEventWireup attribute and made sure that it is set to
true everywhere, webconfig as well as the aspx page itself.

I am also using VS2008.

"Just Me" wrote:

> Should read "Autowireup" @page property
>
>
> "Just Me" <news.microsoft.com> wrote in message
> news:(E-Mail Removed)...
> >
> > Does your page_load event fire ?, if not, check that your Autowireup event
> > is set to true. Also, you didnt comment on the Autopostback I mentioned
> > have you checked this.
> >
> > Whatever you problem is, its likely to be very basic.
> >
> >
> >
> > "Satish" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Nope, tried adding code in SelectionIndexChanged Event and even tried
> >> with
> >> the Debugger, nothing.
> >>
> >> "Satish" wrote:
> >>
> >>> C#, ASP.NET
> >>> Q: Have a formview, with a dropdownlist which is bound to a column. This
> >>> dropdownlist has a datasource of DataSet type. Now my objective is, on
> >>> Selection Changed of this DropdownList, I need to populate a couple of
> >>> TextBox's. How can I do this? What event does the code go into? The
> >>> selectionindexchanged even for the DropDownList does not seem to fire.
> >>>
> >>> Any help is appreciated.
> >>>
> >>> Thanks in advance.
> >>>

> >
> >

>
>
>

 
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
populate FormView fields from a DropDownList mkidd ASP .Net 2 01-15-2008 02:39 PM
Formview dropdownlist won't populate in insert mode, but does in edit mode ??? jobs at webdos ASP .Net Web Controls 0 10-09-2006 03:38 PM
Formview insertitemtemplate won't populate dropdownlist in Insert Mode jobs at webdos ASP .Net 0 10-09-2006 03:35 PM
How to change a range selection to text selection? Loebb Javascript 0 02-23-2004 02:12 PM
Populate List Box base on Combo Box Selection Adrian ASP General 1 02-18-2004 09:49 AM



Advertisments