Implementing user defined display order UI - c#

i have a list of products that are being displayed in particular order. store admin can reassign the display order, by moving the "hot" items to the top of the list. what's the best way of implementing the admin functionality UI [asp.net C#]? Products table has a [displayOrder(int)] filed which determines the display order.
i'm looking for something intuitive and simple.
thank you.
p.s. i guess i didn't make myself clear, i'm looking for UI advice more than anything.
SOLUTION: ReorderList worked out great, this article helped too. Also, make sure OldValuesParameterFormatString="{0}" in your DataSource.

using AJAX you could implement a Reoder list control you can find more information here http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ReorderList/ReorderList.aspx
Mauro
http://www.brantas.co.uk

You need a Rank field for each product (which could also be the DisplayOrder field).
When the administrator ups or downs a product, update the rank value.
When you need to list the products, do a select query which sorts in DESC order of rank.

i'm implementing that using the 'Order' column/property where people input numbers like 10, 20, 30 (i have ascending ordering). i have a list of items with text boxes to input order, and an 'apply order' button that saves new values to the database and reorders/reloads items on the page with the new ordering applied.
i don't forbid inputting the same value for two items, i sort them by name as a second sort parameter, or leave it to the database to sort it at will if it doesn't matter much. i believe it's understandable enough to put it that way, it seems like an ordered list which everybody understand easily.

If you can modify the database, add an IsHot column. Then sort by IsHot and DisplayOrder (in that order). This will keep the products in the correct order and the "hot" products will bubble up to the top.

Related

RDLC Grouping Changes my Sort

I have a simple report which is to be sorted by date.
If I sort by date without grouping, everything is fine. As soon as I add my group, the data is no longer sorted by date.
I have tried added interactive sorting for "Date" on every column and still no luck.
Is there something I am missing? This must be possible!
PS: My data is sorted by date with the SQL.
I did not notice the group automatically added sorting. I fixed this right-clicking the Group, and under sorting I deleted the sort field.
Even I spent a day trying to fix the same issue. The trick is edit the 'Group Properties'
Right click on the cell you are grouping by. Go to Row Group > Group Properties
Click the Tab called Sorting and then add the expression or column you would like to sort on.

Input DropDownList to filter DropDownList items

What I want to do is make a DropDownList with a LOT of items from a Database.
In that DropDownList I want to be able to type in a part of the value of the element, and that way limit the elements of the DropDownList to only those that contain what I filled in.
For example:
When I have a list of products with a name of 10000 to 20000, that's 10.000 items.
To prevents having to pick from all of those, I want to type in a value of let's say the items 10000 to 10010. That takes it down to 10 items.
For example, only those 10 items contain "Box" in their value.
All the other elements don't have "Box" in their value, so they stop showing in the DropDownList until I remove the text.
When it's filtered down to 10 items, I can pick the right one out and select it.
When I do that it needs to automatically fill the whole value of that element into a textarea.
Does anyone know how to go about doing that?
Thanks in advance.
Milan.
You may want to look at the ASP.Net AJAX Control Toolkit. The autocomplete extender is just what you are looking for.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
And as suggested by Chris Hardie, you may have a look at the jQuery UI autocomplete as well: http://jqueryui.com/autocomplete/
Use whatever you are comfortable with.

How to sort both the content inside the group and the whole data in SSRS

How to group the list in the page in SSRS. I have person_last_name,person_first_name,person_id,email_addres in my table. I need to do sort the list in the SSRS report.
In my report I have grouped with person_last_name and to sort the data I have used the sort property in the tablix properties. The data on the whole is sorted when I selected "Details" option. Then I tried to sort the content inside the grouped item that was also successful. How can I sort both the content inside the group and the whole data.
Suppose you have a Teacher with students and you want to sort the teachers by last name and the students by last name up or down. You would need to add a sort to you top level group, in this case teacher, and also to the detail group the sort expressions can be set independently.

How to persist/store values at runtime

I have a scenario which is as follows:-
A form containing 2 grids. The grid on the left contains a list of groups. When a group is selected the grid on the right populates with another list with check boxes.
I would like to be able to select group A and select some random check boxes and then switch to group B and select some other check boxes. However when I select group A again I would like to be able to restore the previously selected check boxes.
This would allow me to preload the settings from the database and also update the changes in one go rather than expecting the user to select apply after the changes for each group.
I'm unsure of the best way to approach this problem. Any feedback is appreciated.
Thanks
Sean.
I've done something like this using DataTables and DataViews to implement client-side filtering.
You have a dataTable with the tickboxes that contains all groups of data.
Then when you click grid 1, you update the DataSOurce of the grid to a new DataView(DataTable,"GroupID=1")
,"",CurrentRows) (i.e. Sets the filter proprety of the DataView to filter on the selected group
THen when you're done, the DataTable has all the tick boxes you just saev the DataTable to the database.
Hope that makes sense.
I'd start with coming up with a database table to store your data - let's say MyTable(UserId, GroupId, ItemId, Selected). When the app starts I'd read the data from the table based on the UserId. I'd process this data into a couple of collections that I could associated with the grids - one having unique groups, the other items associated with a group and the selection status. Set up some event handlers to keep the collections in sync with the user input. Implement some save routine upon hitting a button or form closing and you should be good !

is there a good way to display too much information in ASP.NET?

I find myself in a quandry that I think I know the solution to but I'd like to ask the field. I have an ASP.NET (C# 2.0 framework) page within a site which is used as a lookup. Standard gridview control, 5 columns of data, hyperlink for the 6th column to do something with record the user wants to select.
My question goes towards how to best display 'a possible' 100k records in that gridview? As it stands right now I'd sprout a few more gray hairs before it ever returns a rendered result. The gridview, for its realestate can display about 20 rows of data on the screen at a time, so paging the data still gives me 5000 pages. Adding in a rolodex-type search on A-Z the largest return set on 'J' gives me 35000 records (where alas 'X' only has 54).
Do I just break the rolodex up smaller or is there a better way to handle a situation like this?
thanks in advance!
edit: I already have the stored procedure which populates this set up for paging like GenericTypeTea suggested, again even with paging on 'J' that would give me 1750 pages. The reason I have that much data is that the amount of participants on the given auto policy. The admin needs to be able to search for a given name, or a partial. 'Jones' has 1209 records and 'Smith' has 2918 so even that makes for a rebust result set.
edit #2: added 'a possible' 100k, there is no guarentee that the account will have that many records, on the other hand it could have more :(
AutoComplete is your friend :)
Just let people enter the first 2 or 3 characters then filter your searches.
With a dataset that large I don't think paging would make that much sense.
jQuery has a nice example page AutoComplete Examples
Filters. Don't show that much data. Show the first x records. And beyond that, the user will need to be more precise with their search. Nobody will look through 100k records for the one they want. I'd limit it to a couple hundred at most (10 pages, 20 per page).
Advise the user how many results there were though, or give some clue so they know that there were many that aren't shown, and they need to be more specific in their search
It seems to me like adding search capabilities would be more efficient than filtering or paging.

Categories