473,671 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capture onselectedindex change from nested dropdownlist

1 New Member
I have a repeater control with a DropDownList in the header template. I am trying to make a database call and sort the results by the selectedIndex property of the drop down. The SelectedIndexCh anged event is not getting fired, feel like I've tried everything.

Repeater Code
*************** *************** *************** *************** *************** *************** *************** *************** **********
<asp:Repeater ID="rptRecords " OnItemCreated=" rptRecords_OnIt emCreated" runat="server">
<HeaderTemplate >
<table class="bordered " Width="100%" align="center" cellpadding="2" >
<tr class="header_r ow">
<th class="h_12" colspan="19" align="left">
<asp:Label ID="lblTitle" Text="" CssClass="h_12" runat="server" />
</th>
</tr>
<tr>
<td colspan="19" align="right">
Sort by:&nbsp;
<asp:DropDownLi st
OnSelectedIndex Changed="ddlSor t_SelectIndexCh anged"
ID="ddlSort"
AutoPostBack="t rue"
runat="server">
<asp:ListItem Text="Project ID" Value="M.OBID" />
<asp:ListItem Text="Project Type" Value="ProjectT ype" />
<asp:ListItem Text="TPM Team" Value="TPMTeam" />
<asp:ListItem Text="Infrastru ctureType" Value="Infrastr uctureType" />
<asp:ListItem Text="Priority" Value="Priority " />
<asp:ListItem Text="Status" Value="Status" />
<asp:ListItem Text="Phase" Value="M.DMAIC" />
<asp:ListItem Text="Dispositi on" Value="Disposit ion" />
</asp:DropDownLis t>
</td>
</tr>
</HeaderTemplate>

Non working code
*************** *************** *************** *************** *************** *************** *************** *************** *********
protected void rptRecords_OnIt emCreated(objec t sender, RepeaterItemEve ntArgs e)
{
if (e.Item.ItemTyp e == ListItemType.He ader)
{
DropDownList ddlSort = (DropDownList)e .Item.FindContr ol("ddlSort");
ddlSort.AutoPos tBack = true;
ddlSort.Selecte dIndexChanged += new EventHandler(dr opDownList_Sele ctedIndexChange d);
}
}

protected void dropDownList_Se lectedIndexChan ged(object sender, EventArgs e)
{
RepeaterItem rptItem = (RepeaterItem)( ((Control)sende r).NamingContai ner);
DropDownList ddlSort = (DropDownList)r ptItem.FindCont rol("ddlSort");
m_SortExpressio n = ddlSort.Selecte dValue;
LoadData();
}
Mar 29 '07 #1
0 1201

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1817
by: steve roszko | last post by:
I have a dropdownlist in a column of my datagrid. When the user changes the value in the ddl, I want to fire off OnSelectedIndexChange event and do an update based on the id held in a hidden column of the grid. But I cannot seem to get to that cell info from my OnSelectedIndexChange procedure. Here is some of the code:
2
2164
by: Greg Fischer | last post by:
I need to access the properties of a control that is nested in 2 datalists. How do you use findcontrol method to do that? what I have is like this: <asp:datalist id="dlist" runat="server"> <edititemtemplate> <asp:datalist id="dlistdet" runat="server"> <asp:dropdownlist id="ddlTypes" runat="server"></dropdownlist> </asp:datalist>
5
9897
by: glenn | last post by:
Hi folks, If I want to select the first item in a DropDownList, I need to first select any item other than the first item and then next I select the first item which will then fire an event saying that I clicked the first item. Why can't I just select the first item to get an event to fire without having to first select any other item. Thanks for any tips.
6
1744
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost datagrid's OnItemDataBound() method we check for the row in which it's appropriate to add the secondary datagrid. Exactly one row in the topmost grid will contain the secondary grid.
0
5947
by: sgtmarcjones | last post by:
How do I access a dropdownlist that is nested within a Formview ItemTemplate Gridview Template? I want to see a label (lgbTimeKeep ! TextValue of ddlName dropdownlist) instead of a dropdownlist in the FormView ItemTemplate Nested Gridview ddlName ItemTemplate. My label is named lgvTimeKeep and the dropdownlist name is ddlName. Thanks!
0
4657
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box and also get the datakey (in my case personid) of the the rows selected. Please point me in the right direction. This is what i have so far but i have problem accessing the child gridview in the button click event Cheers, Shilpa. <asp:GridView...
2
3743
by: MattB | last post by:
I have a (.Net 1.1) form with a Repeater and a DropDownList in the ItemTemplate. I programmatically make the DDL Autopostback = true at runtime based on the bound data. That works - I can see the postback happen appropriately. The DropDownList looks like this: <asp:DropDownList id="ddMultiQty" OnSelectedIndexChanged="ddMultiQty_SelectedIndexChanged" runat="server"></asp:DropDownList>
5
4109
by: John Kotuby | last post by:
Hi all, After more than a year programming with ASP.NET 2.0 and VB I am still finding it difficult to leave some habits from classic ASP behind. this is particularly true with cross-page posting. My site uses Master pages and user controls. On an Advanced Search page I have numerous entry boxes and listboxes (keywords, categories, etc.) which are primarily standard HTML. I post this page to a different page which lists results and...
6
5749
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the OnSelectedIndexChanged event set on it. This triggers just fine, but within the codebehind of the OnSelectedIndexChanged event, I need to scan through all the entries in the nested GridView (to see if the user changed a value to an already existing value in the...
0
8473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8911
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.