473,385 Members | 1,798 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,385 software developers and data experts.

How can I add an event to a control in a templete column?

I have a templete column, and a DropDownList in header templete. I want to
add a SelectedIndexChanged event to that DropDownList. But I couldn't. How
can I do that?

Thanks...
--
No Sign
Nov 19 '05 #1
2 982
In your HTML for datagrid template, write ... <asp:DropDownList
OnSelectedIndexChanged="MyEvent"></asp:DropDownList>

In you code behind:

public void MyEvent(object source, System.EventArgs e)
{
// Handle your event here...
}

This technique is called event bubbling. Making the event handler's scope as
public is very important
--
Samba!

Nov 19 '05 #2
This works well, thank you very much...
--
Nov 19 '05 #3

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

Similar topics

2
by: Haro Panosyan | last post by:
Suppose I have defined a templete function prototype in a header file and the body in .cpp file and created executable without actually calling the templete function. Now let say from that...
10
by: william | last post by:
Hi, I have a datagrid, inside there is a templete item, it's button. I want to do some thing when user click the button, but do not want the postback event happens. How can I do it? Thanks. ...
3
by: Tina | last post by:
I have an ascx control in the ItemTemplate of a Template Column in a datagrid. The control (myControl) raises an event. I'm trying to figure out how I can subscribe to the event. It can't be...
10
by: Tim Frawley | last post by:
I am attempting to detect a Shift+Tab in the KeyPress event for back navigation on a control that doesn't support this method. Does anyone have any ideas how to compare e.KeyChar to a ShiftTab? ...
0
by: Lance Geeck | last post by:
I am trying to move from VB6 to .NET. I have the enterprise version of VS.NET. I want to be able to build an application using the Enterprise templetes. These include projects for...
4
by: Roger | last post by:
I have a datagrid and would like to know what even fires when a cell is changed? I want to know when the user changes a cell and moves to the next. I have some code that needs to be done to...
16
by: Neil | last post by:
I am using Access 2003, and have an ongoing problem of every once in a while losing an event procedure for a form or control. The procedure's still in the code module, but the form or control's...
1
by: Forumtroll | last post by:
I have a Web User Control that parses an XML file and renders a Form based on the XML. The problem is that I create a button on the bottom of the form that will fire off a subscribeable event, but...
2
by: george | last post by:
I'm have a little trouble understanding how to do this, but what i wanna do is have it so when the user clicks on an item in the menustrip, it activates the column click event in a listview that i...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.