473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SelectedIndexChanged 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 SelectedIndexChanged 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 5365
Hi this is the OP.
Here is the code:
//********** ASPX Markup ****************

<asp:GridView ID="gvCRCSearch" runat="server"
AutoGenerateColumns="False" EnableViewState="False"
DataKeyNames="ApplicantID">
<Columns>
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="MiddleName" HeaderText="Middle" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
<asp:BoundField DataField="DOB" DataFormatString="{0:MM/dd/yyyy}"
HeaderText="DOB" HtmlEncode="False" />
<asp:BoundField DataField="PrimaryPhone" HeaderText="Prim. Phone" /
>
<asp:BoundField DataField="Ethnicity" HeaderText="Ethnicity" />
<asp:BoundField DataField="SubmitDate" DataFormatString="{0:MM/dd/
yyyy}" HeaderText="Submit Date" HtmlEncode="False" />
<asp:TemplateField HeaderText="Hired?">
<ItemTemplate>
<asp:DropDownList ID="ddlHired" runat="server"
AutoPostBack="True"
OnSelectedIndexChanged="ddlHired_SelectedIndexChan ged" >
<asp:ListItem Value="False">No</asp:ListItem>
<asp:ListItem Value="True">Yes</asp:ListItem>
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

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

On Sep 15, 10:22*am, aamir <aamirghan...@gmail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexChanged 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...@gmail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexChanged 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.Current.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 SelectedIndexChanged event
for the gridview did not fire as it was in an "invisible panel".

thanks!
On Sep 15, 11:05*am, Chuck <Charles.Pierrot...@gmail.comwrote:
On Sep 15, 10:22*am, aamir <aamirghan...@gmail.comwrote:
Hello, I guess the subject line says it all. I have put Trace.Warn()
in the SelectedIndexChanged 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.Current.Trace.Warn, since it may not be inherited in your
CS code?
Sep 15 '08 #4
On Sep 15, 11:45*am, aamir <aamirghan...@gmail.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 SelectedIndexChanged event
for the gridview did not fire as it was in an "invisible panel".

thanks!

On Sep 15, 11:05*am, Chuck <Charles.Pierrot...@gmail.comwrote:
On Sep 15, 10:22*am, aamir <aamirghan...@gmail.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 SelectedIndexChanged 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.Current.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
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...
0
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...
2
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...
1
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...
0
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...
1
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...
3
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...
2
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...
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.