473,657 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SelectedIndexCh anged event of a DopdownList in a Gridview templatecolumn not firing

Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexCh anged event handler, but it does not get listed
when the trace is on for that page. I have AutoPostback = True for
that Dorpdownlist as well. What could be I missing. Any leads will be
helpful.

Thanks in advance!

Sep 15 '08 #1
4 5377
Hi this is the OP.
Here is the code:
//********** ASPX Markup *************** *

<asp:GridView ID="gvCRCSearch " runat="server"
AutoGenerateCol umns="False" EnableViewState ="False"
DataKeyNames="A pplicantID">
<Columns>
<asp:BoundFie ld DataField="Firs tName" HeaderText="Fir st Name" />
<asp:BoundFie ld DataField="Midd leName" HeaderText="Mid dle" />
<asp:BoundFie ld DataField="Last Name" HeaderText="Las t Name" />
<asp:BoundFie ld DataField="DOB" DataFormatStrin g="{0:MM/dd/yyyy}"
HeaderText="DOB " HtmlEncode="Fal se" />
<asp:BoundFie ld DataField="Prim aryPhone" HeaderText="Pri m. Phone" /
>
<asp:BoundFie ld DataField="Ethn icity" HeaderText="Eth nicity" />
<asp:BoundFie ld DataField="Subm itDate" DataFormatStrin g="{0:MM/dd/
yyyy}" HeaderText="Sub mit Date" HtmlEncode="Fal se" />
<asp:TemplateFi eld HeaderText="Hir ed?">
<ItemTemplate >
<asp:DropDownLi st ID="ddlHired" runat="server"
AutoPostBack="T rue"
OnSelectedIndex Changed="ddlHir ed_SelectedInde xChanged" >
<asp:ListItem Value="False">N o</asp:ListItem>
<asp:ListItem Value="True">Ye s</asp:ListItem>
</asp:DropDownLis t>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>

//******** CS code **************
protected void ddlHired_Select edIndexChanged( object sender, EventArgs
e) {
Trace.Warn("I'm here");
}

On Sep 15, 10:22*am, aamir <aamirghan...@g mail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexCh anged event handler, but it does not get listed
when the trace is on for that page. I have AutoPostback = True for
that Dorpdownlist as well. What could be I missing. Any leads will be
helpful.

Thanks in advance!
Sep 15 '08 #2
On Sep 15, 10:22*am, aamir <aamirghan...@g mail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexCh anged event handler, but it does not get listed
when the trace is on for that page. I have AutoPostback = True for
that Dorpdownlist as well. What could be I missing. Any leads will be
helpful.

Thanks in advance!
I'm still learning this stuff, but my research lead me to this link:
http://newsgroups.cryer.info/microso...092895108.html.

In a nutshell, have you tried to reference the actual method,
HttpContext.Cur rent.Trace.Warn , since it may not be inherited in your
CS code?
Sep 15 '08 #3
Chuck, thanks for the input.
Indeed I was using the full hierarchy and tried it both ways.

Luckily my problem is solved. I have taken out the gridview from the
panel it was in.
The panel's visibile property was set to False by default
purposefully. Therefore on the postback the SelectedIndexCh anged event
for the gridview did not fire as it was in an "invisible panel".

thanks!
On Sep 15, 11:05*am, Chuck <Charles.Pierro t...@gmail.comw rote:
On Sep 15, 10:22*am, aamir <aamirghan...@g mail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexCh anged event handler, but it does not get listed
when the trace is on for that page. I have AutoPostback = True for
that Dorpdownlist as well. What could be I missing. Any leads will be
helpful.
Thanks in advance!

I'm still learning this stuff, but my research lead me to this link:http://newsgroups.cryer.info/microso...amework.aspnet....

In a nutshell, have you tried to reference the actual method,
HttpContext.Cur rent.Trace.Warn , since it may not be inherited in your
CS code?
Sep 15 '08 #4
On Sep 15, 11:45*am, aamir <aamirghan...@g mail.comwrote:
Chuck, thanks for the input.
Indeed I was using the full hierarchy and tried it both ways.

Luckily my problem is solved. I have taken out the gridview from the
panel it was in.
The panel's visibile property was set to False by default
purposefully. Therefore on the postback the SelectedIndexCh anged event
for the gridview did not fire as it was in an "invisible panel".

thanks!

On Sep 15, 11:05*am, Chuck <Charles.Pierro t...@gmail.comw rote:
On Sep 15, 10:22*am, aamir <aamirghan...@g mail.comwrote:
No probs. I forgot about that aspect myself. lol Thanks for
refreshing my memory.
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexCh anged event handler, but it does not get listed
when the trace is on for that page. I have AutoPostback = True for
that Dorpdownlist as well. What could be I missing. Any leads will be
helpful.
Thanks in advance!
I'm still learning this stuff, but my research lead me to this link:http://newsgroups.cryer.info/microso...amework.aspnet....
In a nutshell, have you tried to reference the actual method,
HttpContext.Cur rent.Trace.Warn , since it may not be inherited in your
CS code?
Sep 16 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7791
by: Stephen | last post by:
My primary GridView is firing an OnDataBound after Selecting a row (which triggers SelectedIndexChanged). This only happens in the following scenario: - User enters a textbox search value and hits "GO" - Gridview is filled with results (4 grids in all, only the "primary" is filled at this point) - User Selects a row from the gridview. - User clicks an "Add" button which calls a javascript window.showmodaldialog
0
5416
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this board. I have a form that contains a ListView and a GroupBox control. The GroupBox control itself contains several TextBox Controls. I have Validating and Validated event handlers set for the GroupBox control, and a SelectedIndexChanged event...
2
17004
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of the columns of the data grid contains a DropDownlist. I managed to create this datagrid control as follows.
1
8383
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What I want to do is to allow the user to click on the row that corresponds to the correct address, and have the code behind populate the form's Address1, Address2 etc. controls with the relevant data items. I put the code for this into the...
0
1742
by: tafpin | last post by:
I have an application with a datagrid. In the IDE I have 2 template columns. The first has an image button and the second contains a link button. According to the results that I get back I must add more columns to the datagrid. This is a sample of how I am adding these colums: templateColumn = New TemplateColumn
1
3080
by: Mark Gilkes | last post by:
I have a DataGrid which I am adding to the page dynamically at the Init stage of the page load. The DataGrid has AutoGenerateColumns turned off, has BoundColumns and is bound to a DataView for its’ data source. I have also added a TemplateColumn which is defined in a derived class and contains an ImageButton. The derived TemplateColumn class contains an event handler for DataBinding and in this handler I assign the ImageButton ID. The...
3
2625
by: Alec MacLean | last post by:
Hi, I have a couple of win forms where I am editing values that are stored in a SQL database. I'm using the listbox control to hold the data object each form interacts with. Each object is defined by my own classes. On the first form, I use an approach to reduce the number of database calls. This essentially consists of :
2
3295
by: jnoody | last post by:
The problem I am having is with the SelectedIndexChanged event not always firing or the SelectedIndex property not being correct when the event does fire. The code is below, but here are some details first. The DropDownList is actually a custom control called DropDownListWithCommandEvent that inherits from DropDownList. The reason I have created this is to create a DropDownList that will bubble a Command event to the containing...
7
17312
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi all! I have a gridview inside a datagrid (nested) for which (gridview) the rowcommand is not raised in order to delete a row from the grid! I also tried OnRowCommand="method", didn't work either! Does anyone know how can I make this work? Thanks in advance!
0
8407
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
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
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...
0
5638
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
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.