logo       
Bookmark and Share

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

Subject: Re: RE: Where to write event for dropdownlist in datagrid
When you put that function call directly into your code with the 
OnSelectedIndexChanged="<%# TestFunction %>" the OnSelectedIndexChanged 
event will call whatever the TestFunction returns. So if TestFunction 
returns "FooBar" (a string) then the FooBar function will fire when the 
index changes. Or you could say OnSelectedIndexChanged="TestFunction". I 
guess the first example allows you to programatically change your events 
fired. I don't see the upside of that of the top of my head.

- Justin


 On 8/17/05, David Lambert <dal@xxxxxxxx> wrote: 
> 
> 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]
> 
> 
> 
> SPONSORED LINKS 
>   Portland 
> oregon<http://groups.yahoo.com/gads?t=ms&k=Portland+oregon&w1=Portland+oregon&w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=S82HyuXoy8HI79OVDPQGig>
>  Software 
> developer<http://groups.yahoo.com/gads?t=ms&k=Software+developer&w1=Portland+oregon&w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=ZwMIT9wBOJJAZZHIc4UiXg>
>  Computer 
> internet<http://groups.yahoo.com/gads?t=ms&k=Computer+internet&w1=Portland+oregon&w2=Software+developer&w3=Computer+internet&c=3&s=68&.sig=exfGXbNGjvyPqxL5qcXuAw>
>  
>  ------------------------------
> 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<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=12hu7alvj/M=362329.6886308.7839368.1510227/D=groups/S=1705007709:TM/Y=YAHOO/EXP=1124329165/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

 


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