473,395 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,395 software developers and data experts.

How can I let the user change the order of items in a repeater?

Hello,

I have a repeater showing a list of items and I would like to be able to
allow the user to change the order of the items. I have absolutely no
idea how to go about this, other than having a pair of Move Up/Down
buttons, which would result in a postback for every single move. This
would be very slow and frustrating for a user trying to move an item to
the top of a list.

Any ideas welcome. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
4 2517
It's possible to move them on the client using JavaScript.

My question is, what is rendered out to the client? If it is just random
html, it might be pretty difficult.

A 3rd party control would have a more sophisticated JavaScript Object
Notation model for capturing, moving, editing specific client side items.
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Alan Silver" wrote:
Hello,

I have a repeater showing a list of items and I would like to be able to
allow the user to change the order of the items. I have absolutely no
idea how to go about this, other than having a pair of Move Up/Down
buttons, which would result in a postback for every single move. This
would be very slow and frustrating for a user trying to move an item to
the top of a list.

Any ideas welcome. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #2
>It's possible to move them on the client using JavaScript.

Any suggestions how? Javascript isn't my strong point ;-(
My question is, what is rendered out to the client? If it is just random
html, it might be pretty difficult.
Not sure what you mean here. The data in the repeater is just text, not
HTML.
A 3rd party control would have a more sophisticated JavaScript Object
Notation model for capturing, moving, editing specific client side items.


Do you know of one?

Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3
If you aren't fond of doing postbacks, you will need to become a superstar at
JavaScript. Once you learn how to use it, your whole design process will
change!

Anyways, can you send me a sample of what kind of html is generated by your
control?

Basically, you will need to assign an id to each element that you want to
move. Then, you will need JavaScript event handlers for the mouse down event
and mouse up event so that you can capture which control was clicked on and
where it was dragged to. Then, you will have to rewrite the html in the new
order.

Huge task huh? Look at the ComponentOne and Infragistics tools or R.A.D.
they all have very advanced client side code.

If cost is an issue, find a control in the above companies toolset that you
like and search google for a cheap/free version?
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Alan Silver" wrote:
It's possible to move them on the client using JavaScript.


Any suggestions how? Javascript isn't my strong point ;-(
My question is, what is rendered out to the client? If it is just random
html, it might be pretty difficult.


Not sure what you mean here. The data in the repeater is just text, not
HTML.
A 3rd party control would have a more sophisticated JavaScript Object
Notation model for capturing, moving, editing specific client side items.


Do you know of one?

Thanks for the reply.

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #4
>If you aren't fond of doing postbacks, you will need to become a superstar at
JavaScript. Once you learn how to use it, your whole design process will
change!
It's not my fondness (or lack) of postbacks that is the issue, this is
part of a much bigger form, and the user might not want to post the form
yet. They might not even be able to as other controls may fire
validation warnings, preventing them from posting until they fix the
data issues.
Anyways, can you send me a sample of what kind of html is generated by your
control?
Plain old HTML table containing a list of product variations and sizes,
for example...

Small 1.99
Medium 2.99
Large 3.99

I just want them to be able to set the order. In many cases, if ordered
alphabetically, you would have an illogical ordering.
Basically, you will need to assign an id to each element that you want to
move. Then, you will need JavaScript event handlers for the mouse down event
and mouse up event so that you can capture which control was clicked on and
where it was dragged to. Then, you will have to rewrite the html in the new
order.
Ulp.
Huge task huh? Look at the ComponentOne and Infragistics tools or R.A.D.
they all have very advanced client side code.
I have the C1 components, but haven't really investigated any of them
yet. Do they have anything similar to this, or were you just pointing
out that complex JS is a fact of life if you want a decent interface?
If cost is an issue, find a control in the above companies toolset that you
like and search google for a cheap/free version?


I had a thought that I could offer a link where they can open a
secondary window containing a listbox of the current variations and
allow them to order that. I think that would be easier than the way you
suggested. They would have to post back at the end, but it would be part
way there. I was going to look around for some js examples of this sort
of thing.

Thanks for the comments.

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #5

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

Similar topics

2
by: Ken Fine | last post by:
(originally posted to one of macromedia's groups; no help, so hopefully someone here can help me out. I'm using VBScript ASP.) When designing administrative interfaces to websites, we often need...
2
by: theComputer7 | last post by:
I cut down the code to make this half way understandable... I have read Data Grid girls caution about over use of dynamic controls. I truly believe what I am doing requires dynamically inserted...
1
by: Mark Fox | last post by:
Hello, I have a repeater and in each itemtemplate I have a radiobuttonlist. I am attempting to figure out how on postback I could iterate through the rows displayed by the repeater and for...
1
by: mrwoopey | last post by:
I have a repeater control in a asp.net app. Once the repeater is fill with data (via bind) I would like to go through the repeater and change the color of one of the items. I can get to where the...
3
by: Sam Kuehn | last post by:
I have been stuck on this for some time and am desperate for a solution. I run into this all of the time! I will give a over simplified example to illustrate the problem. Say you have 2 user...
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
1
by: Jonathan Wood | last post by:
Okay, as evidenced by other questions, I am an experienced programmer very new to ASP.NET. I have a vertical navigation bar. It is all one color with several panels inside it with a different...
4
by: bill | last post by:
I have a Repeater control in a web user control. The web user control has a public method named PopulateRepeater which takes an ID as an parameter and populates the repeater control based on the...
2
by: Nemo | last post by:
Hi, I have i fishy problem when I have e Repeater with user controls. page_load { if (!isPostBack) { repeater.databind(); }
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: 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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
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.