logo       

RE: Where to write event for dropdownlist in datagrid: msg#00030

Subject: RE: Where to write event for dropdownlist in datagrid
Ok, I've finally figured this out.  The method I thought I'd need to use
was to code in the dropdownlist
OnSelectedIndexChanged event property in the aspx page thusly...
 
<asp:DropDownList id=ddlHeadings runat="server" AutoPostBack="True"
DataTextField="Heading" DataValueField="Heading" DataSource="<%#
GetItemHeaders(True) %> OnSelectedIndexChanged="<%# TestFunction %>">
 
what actually works is...
 
<asp:DropDownList id=ddlHeadings runat="server" AutoPostBack="True"
DataTextField="Heading" DataValueField="Heading" DataSource="<%#
GetItemHeaders(True) %> OnSelectedIndexChanged="TestFunction">
 
where the call OnSelectedIndexChanged="TestFunction" executes the
TestFunction in the server vb code.  The problem was I was using the
same formating as I was using for the datasource and selected index
properties which codes in a <%# notation around the function call.  In
examining yet another example I noticed that this odd notation was
missing.
 
It's not really obvious to me when and why this notation is necessary
(and maybe someone can enlighten me) but it was what was preventing my
routine from firing the event.
 
David
 

  _____  

From: padnug@xxxxxxxxxxxxxxx [mailto:padnug@xxxxxxxxxxxxxxx] On Behalf
Of David Lambert
Sent: Wednesday, August 17, 2005 2:06 PM
To: padnug@xxxxxxxxxxxxxxx
Subject: [padnug] Where to write event for dropdownlist in datagrid


This seems easy

Filter the results datasource that populates a dropdownlist by a
selection made in a second dropdownlist.  It actually is pretty easy if
the second dropdownlist control is not in a template column in a
datagrid.  However both dropdownlists exists in the same template column
and I'm having trouble figuring out how to trap the event.

Currently I'm populating the list datasource for both controls from the
aspx source page thusly

control1
<asp:DropDownList id=ddlItem runat="server" SelectedIndex='<%#
GetTagDescrSelectedIndex(DataBinder.Eval(Container.DataItem, "ItemTag"))
%>' DataTextField="FullDescr" DataValueField="ItemTag" DataSource="<%#
GetItemDescrDS(True) %>">

control2
<asp:DropDownList id=ddlHeadings runat="server" AutoPostBack="True"
DataTextField="Heading" DataValueField="Heading" DataSource="<%#
GetItemHeaders(True) %>"


The number of items in the first control is well over a thousand, so the
idea is to use the second control to select a smaller subset of items,
and thus make it easier for the user to find his selection in the list.

My problem is because the second dropdownlist control is created
dynamically in a datagrid I cannot directly reference the
selectedindexchanged event.

Any help would be greatly appreciated, thanks






[Non-text portions of this message have been removed]




SPONSORED LINKS 
Portland
<http://groups.yahoo.com/gads?t=ms&k=Portland+oregon&w1=Portland+oregon&;
w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=S82HyuXoy8HI79O
VDPQGig> oregon         Software
<http://groups.yahoo.com/gads?t=ms&k=Software+developer&w1=Portland+oreg
on&w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=ZwMIT9wBOJJA
ZZHIc4UiXg> developer   Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+internet&w1=Portland+orego
n&w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=exfGXbNGjvyPq
xL5qcXuAw> internet     

  _____  

YAHOO! GROUPS LINKS 


        
*        Visit your group "padnug <http://groups.yahoo.com/group/padnug>
" on the web.
  

*        To unsubscribe from this group, send an email to:
 padnug-unsubscribe@xxxxxxxxxxxxxxx
<mailto:padnug-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
  

*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 


  _____  






[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hni4u9n/M=362131.6882499.7825260.1510227/D=groups/S=1705007709:TM/Y=YAHOO/EXP=1124325649/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

 


<Prev in Thread] Current Thread [Next in Thread>