473,407 Members | 2,359 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,407 software developers and data experts.

DataList selection

Hi,

I have a DataList which is filled with a custom control. The custom control
contains a image and a label. The problem is that neither the
SelectedIndexChanged event of the DataList is fired nor the SelectedItem
template is shown (same custom control with different back color and fore
color) when clicking on a control inside the DataList. What am I doing wrong
here?

Regards,
Michael
Nov 19 '05 #1
3 1387
Hi Michael:

The SelectedIndexChanged event fires when the user selects a specific
control in the list - not just any control. The general approach is
for people to add a Button or an ImageButton to each row (think of it
as the "Select" button, and wire the Select button to the
SelectedIndexChanged event.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 6 Apr 2005 15:17:28 +0200, "Michael Groeger"
<go*********@web.de> wrote:
Hi,

I have a DataList which is filled with a custom control. The custom control
contains a image and a label. The problem is that neither the
SelectedIndexChanged event of the DataList is fired nor the SelectedItem
template is shown (same custom control with different back color and fore
color) when clicking on a control inside the DataList. What am I doing wrong
here?

Regards,
Michael


Nov 19 '05 #2
Hi Scott,

so for my understanding, is it correct, that SelectedIndexChanged wires to
the Button.Click event, it might help, if my custom control simply exposes a
click event itself, which gets triggered, whenever a control inside is
clicked?

Regards,
Michael

"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag
news:cl********************************@4ax.com...
Hi Michael:

The SelectedIndexChanged event fires when the user selects a specific
control in the list - not just any control. The general approach is
for people to add a Button or an ImageButton to each row (think of it
as the "Select" button, and wire the Select button to the
SelectedIndexChanged event.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 6 Apr 2005 15:17:28 +0200, "Michael Groeger"
<go*********@web.de> wrote:
Hi,

I have a DataList which is filled with a custom control. The custom controlcontains a image and a label. The problem is that neither the
SelectedIndexChanged event of the DataList is fired nor the SelectedItem
template is shown (same custom control with different back color and fore
color) when clicking on a control inside the DataList. What am I doing wronghere?

Regards,
Michael

Nov 19 '05 #3
Yes, you could wire things up that way, too.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 6 Apr 2005 16:30:30 +0200, "Michael Groeger"
<go*********@web.de> wrote:
Hi Scott,

so for my understanding, is it correct, that SelectedIndexChanged wires to
the Button.Click event, it might help, if my custom control simply exposes a
click event itself, which gets triggered, whenever a control inside is
clicked?

Regards,
Michael

"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag
news:cl********************************@4ax.com.. .
Hi Michael:

The SelectedIndexChanged event fires when the user selects a specific
control in the list - not just any control. The general approach is
for people to add a Button or an ImageButton to each row (think of it
as the "Select" button, and wire the Select button to the
SelectedIndexChanged event.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Wed, 6 Apr 2005 15:17:28 +0200, "Michael Groeger"
<go*********@web.de> wrote:
>Hi,
>
>I have a DataList which is filled with a custom control. The customcontrol >contains a image and a label. The problem is that neither the
>SelectedIndexChanged event of the DataList is fired nor the SelectedItem
>template is shown (same custom control with different back color and fore
>color) when clicking on a control inside the DataList. What am I doingwrong >here?
>
>Regards,
>Michael
>


Nov 19 '05 #4

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

Similar topics

1
by: Barry | last post by:
I have a three-level drilldown report. The top level is a DataList. When an item is selected, a new DataList is instantiated in the SelectedItem template. I'd like to have the same thing happen...
6
by: Mary Kerrigan | last post by:
I have a user control (menu) with a data list: <asp:DataList id="MyList" runat="server"> <ItemTemplate> <asp:hyperlink cssclass="MenuUnselected" id="myLink1" Text='<%#...
0
by: Ashish Sharma | last post by:
I have a drop down list inside a data list on a form like this : <asp:DataList ID="DataList1" runat="server" EnableViewState="False"> <ItemTemplate> <asp:Label ID="lblname" Runat="server"...
1
by: mahsa | last post by:
H data I'm binding to the DataList is information about products in my product database. Perhaps passed in the QueryString to this page is a ProductID. I might want to make the item in the DataList...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
4
by: bienwell | last post by:
Hi all, Data displayed on the datalist control is bound by the column name of the dataset like this : <%# DataBinder.Eval(Container.DataItem, "title")%> Could I use an element of the array...
4
by: Chris Kettenbach | last post by:
Good morning all, I am sure this has been asked but I did not see anything. I have a datalist control. In the edititemtemplate I have a dropdownlist. I know on the itemdatabound event is where I...
0
by: Isz | last post by:
PROBLEM: This problem is related to the postback and handling events correctly. BACKGROUND: I have a datalist which acts as a tabbes list with horizontal layout. This datalist is bound to a...
1
by: MadTurtle | last post by:
The basic scenario: I have a tab control that is really just a Datalist which contains an ItemTemplate and SelectedItemTemplate. A LinkButton is contained in each of these templates with a CSS...
3
by: Crazy Cat | last post by:
Hi all, I am developing an asp.net 2.0 application in Visual Studio 2005. On my page I have a simple datalist that is bound programmatically to a collection of simple objects. On this page I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.