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

DataList Controls with a DropDownList

Hi,

I've created a shopping cart using DataList control; it has all the usual
command buttons; Add, and Delete. However, I want to add a DropDownList so
that the user can change the product (very small product list) and I want the
SelectedIndexChanged event to be posted back to the Data List's ItemCommand
event.

I've tried added GetPostBackEventReference to the drop down list during the
Data List's ItemCreated event - The form will post back but I cannot get it
fire the ItemCommand event no matter what parameters I use in the
GetPostBackEventReference. I'm not even sure if this is right way to do this.

Any suggestions would be greatly appreciated.

Nov 19 '05 #1
2 1998

"Oliver" wrote:
Hi,

I've created a shopping cart using DataList control; it has all the usual
command buttons; Add, and Delete. However, I want to add a DropDownList so
that the user can change the product (very small product list) and I want the
SelectedIndexChanged event to be posted back to the Data List's ItemCommand
event.

I've tried added GetPostBackEventReference to the drop down list during the
Data List's ItemCreated event - The form will post back but I cannot get it
fire the ItemCommand event no matter what parameters I use in the
GetPostBackEventReference. I'm not even sure if this is right way to do this.

Any suggestions would be greatly appreciated.


I did a while ago a similar application using the datagrid.
http://www.societopia.net/Samples/Da...Delegates.aspx

You can adapt it to create a customized DataList that works for your
application.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
Nov 19 '05 #2
Thanks for you reply Phillip,

I managed to resolve the issue by creating a user control that contains the
drop downlist and using the RaiseBubbleEvent to pass the event back to the
DataList Control.

"Phillip Williams" wrote:

"Oliver" wrote:
Hi,

I've created a shopping cart using DataList control; it has all the usual
command buttons; Add, and Delete. However, I want to add a DropDownList so
that the user can change the product (very small product list) and I want the
SelectedIndexChanged event to be posted back to the Data List's ItemCommand
event.

I've tried added GetPostBackEventReference to the drop down list during the
Data List's ItemCreated event - The form will post back but I cannot get it
fire the ItemCommand event no matter what parameters I use in the
GetPostBackEventReference. I'm not even sure if this is right way to do this.

Any suggestions would be greatly appreciated.


I did a while ago a similar application using the datagrid.
http://www.societopia.net/Samples/Da...Delegates.aspx

You can adapt it to create a customized DataList that works for your
application.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com

Nov 19 '05 #3

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

Similar topics

1
by: Scott Schluer | last post by:
Hello, I've got myself a small problem and I'm hoping someone can help. I have a DataList called dlProducts (displays products from a database). Within the <ItemTemplate> container of the...
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"...
8
by: Adam Billmeier | last post by:
Problem: I am trying to use FindControl to grab a dropdownlist that is in the EditItemTemplate of a Datalist and then Bind it to a dataset. I also then need to put the correct values in all of...
2
by: Shiju Poyilil | last post by:
Hi ! I have a requirement wherein i am binding a datalist which contains a label (Caption for the field) and some literal hidden fields and a dropdown list. When I am binding to 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...
2
by: Roman | last post by:
I have built a simple user control that contains 2 buttons, a text box and a dropdownlist. When a button is clicked it sets the visible property of the textbox/dropdownlist and the button. ie the...
0
by: bryanp10 | last post by:
I have a DataList on my page which contains multiple DropDownLists. My page defaults to showing six rows in the DataList. I want the ability to dynamically add rows if needed. Right now I'm just...
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...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am having this problem. I have this datalist and whenever I expand the datalist by the plus button, it overlaps other controls on my web page and sometimes these controls come...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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: 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...

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.