ListView add more items in Metro apps? - html

I have a metro application in which I have a Listview and service data contains above 100 items. Initially when am loading listview in my page it has to display only 8 items plus 1 more-related item and later if i click on a more-item it needs add another 9 items to my page and totally it has to show 17 items in my page and need to display more item also like that flow continues.What should I get to get my scenario.Can anyone help me.Below I tried to give u my scenario.
Thank you.

Take a look to this article: http://www.silverlightplayground.org/post/2012/06/10/Metro-Incrementally-load-GridView-and-ListView-with-ISupportIncrementalLoading.aspx.

There are a couple of solutions -- all depending on the work that you want to undertake. Also, I would suggest that you don't have a "More" button if you can help it -- it's not the best user interaction. Option 2 is going to give you the best experience.
Option 1
Use WinJS.Binding.List as your data source -- using this you can manipulate it like a JavaScript Array (e.g. push, pop etc). As you add & remove items from the list, the list view will react to those changes.
Full details are here.
Option 2
Create a VirtualDataSource derivation that is intimately aware of the ways in which you can request your data, and can offer up a consistent interface to the ListView. This enables your UI to be completely flexible to it's layout, and request enough data to satisfy the available space, while virtualizing the UI elements (better memory/performance), and the data (ensuring only the data needed by the user is requested.
Full worked example here.

Related

MVC 5 Cascading Data

I am working on an MVC 5 razor page (using Entity Framework 6) that will display Vendor information. Each vendor can have multiple classes, and each class can have multiple subclasses. What I want to do is display the vendor information at the top, show the list of classes below that info, and then have a third section with a list of subclasses for the selected class. My question is what is the best way to do this?
Currently I am trying to do it with the main page getting passed a model of type vendor, and then within that page, displaying two partial views via #Html.Action("ActionName", "ControllerName", value). I can pass the class list partial view the ID of the vendor when the page loads without issue, the real problem is figuring out how to pass the selected ID of a class to the partial view for subclass. I've tried using hidden fields, but I'm not sure how to pass the html.Action the value of the hidden field.
This is my first MVC application, so any help is much appreciated.
First off, you are saying that you are using partial views with #Html.Action() helper - this is not for a partial view, but rather to produce a link to navigate to another page...That being said, I think I know what you want to do.
Second off, you need to post more code to show you made an attempt - stack overflow is not a source of free development consulting work. I think I know what you are trying to do, but even posting some sort of UI mockup might make a general discussion easier. That being said, I won't give you any code in the answer, just a general idea of how I would approach the problem.
To start, you should have a dedicated controller for Vendor, VendorClasses, and whatever the third subclass is (I'm going to assume its called VendorSubClass for the sake of example) since you chose the MVC pattern.
Next comes the part about displaying all of the information on a single page. The only place I could potentially see it making sense to show all of that info is on the views for VendorSubClass (however only VendorSubClass properties should be editable here) and even then, it might just make sense to have really informative breadcrumbs instead.
You would need to pass an object to the view that contained the VendorSubClass, its parent VendorClass, and its grandparent Vendor information. If you're using entity framework, this is a snap (but you didn't say you were so I'm making my explanation more generic). Then, you can reference partial views by using the helpers:
#Html.Partial('VendorPartial', Model.Vendor)
#Html.Partial('VendorClassPartial', Model.VendorClass)
as you can see above, I am not passing IDs - but rather the actual properties(objects) themselves which the partial views will use to render the details. This overview should get you started and give you some stuff to google.

Hold data for list to add later?

So no SQL tables or anything here. Basically, I have 3 pages that have 6 items each. Each item consists of an image and then some text and also a smaller image than changes from a check to an "x" depending on if user selects or not. So if the image is checked, the user is adding that to a list which would display on a fourth page. This data needs to persist through just a session and if the session times out, then it resets. If the list is complete and on that fourth page the user choices to email or share list via social sharing, then the data would be gone after that action. What I am trying to figure out is the best way to approach and implement this with minimal time and effort as it has to go out quickly. Can any of you explain and maybe point to some links with info on the best way to achieve?
This is being done in asp.net web forms with html, css, and javascript.
Much appreciated!
You can use ViewBag() (for view in razor) or ViewData[] (for page in .net) to hold data for one web page.when you want it to other page. You can pass it to other page.
check this out
ViewBag, ViewData and TempData

How to set focus on tab in tabcontrol in URL

I am trying to call a page in my customers webapplication (Exact Synergy Enterprise)
This is the link: http://someserveridontdisclose/Synergy/docs/CSCANEduCourseCard.aspx?ProjectNr=ACPGINTV
Within this page is an Ajax TabContainer with several TabPanels. One of them is called 'Doelgroepen'
I dont have the source for this application, as i am not the developer of it. We only develop custom extentions to it.
Here's the question: Is it possible to focus on one of the tabs USING ONLY AN URL? If so How?
Thank you very much for your thoughts about this.
try to set with javascript. you'll have to write your own js to get index number you want from url, then set like this
$find('<%=TabContainer1.ClientID%>').set_activeTabIndex(2);
http://forums.asp.net/t/1127834.aspx
http://www.aspforums.net/Threads/420684/ASPNet-AJAX-TabContainer-Set-Active-Tab-Client-side-using-JavaScript/
If you do not have access to the code and if this is not part of the requirement / design specification for the application you are using (ie: what you asked the developer to do), then the answer is No.
The control does not have "native" support for URL tab selection. There needs to be specific code in the application in order to handle this.
It is however very easy to implement, if you absolutely need it, it shouldn't take much time (about 15-30 lines of code, depending on how many tabs/urls combination you need).
You can find a running sample of the AjaxControlToolkit Tabs control at the following link (the available functionnalities are described in there):
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Tabs/Tabs.aspx
If the TAB has an ID you could make it visible by adding '#tabid' to the URL.

How to add footer to the list box in windows phone 8

I'm doing one windows phone 8 application. In this I've used list box. For the very first page I'm getting the data from server and adding that data to list box. Now I want to add Show More at the bottom of the list box i.e after the last item, to get the next items from the server.
How could I achieve this?
Hear you have to use Horizontal scrolling for load next data
Check below tutorial
Detect when a ListBox scrolls to its end (WP7)
Windows phone tutorial:Listbox
WP7 – How To Extend ListBox When Reaching Last Item
Windows Phone 7 ListBox Pagination with MVVMLight & ApplicationBar
we can Gets or sets the amount of data to fetch for virtualizing/prefetch operations by using
ListViewBase.DataFetchSize property and can Initiates the asynchronous request to load more data items, in accordance with the active incremental loading settings by ListViewBase.LoadMoreItemsAsync method.
If you want to do it by pagination then the following links may be helpfull for you
DataFetchSize method
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.datafetchsize.aspx
LoadMoreItemsAsync method:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.loadmoreitemsasync.aspx
You can see examples of using these here (though note that the sample was based on Windows 8 BUILD release and the apis have had some changes)
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e71b7036-4fb7-4963-a65d-5bcb9fd8f664
I'll go ahead posting the logic as My code might not match with yours
So
1 -> Save the server data in an array or a list.
2 -> Design the xaml in a way that the Parent Grid has two or more rows with the last row for the show more. And the one before for the list. (Adjust height accordingly)
3 -> Populate it with a limited amount of data.
4 -> Next use the ListBox.Items.Add(data) method to add the data to the list. Keep sorted property off so that the elements are inserted at the bottom of the list
-> Go through the link Add Method for Observable Collections
Use step four on the show more button click .. and also adjust the height of the list or put it into a scrollviewer so that limited height scrolling can be done . olease update if further queries

QTableView drag move rows

I'm using a QTableView with a QAbstractTableModel and a QSortFilterProxyModel so that I can sort the items by clicking on the table headers. I'd like to add the option for the user to sort the rows in the view manually, by dragging them. I don't need to be able to do drag and drop from/to any external application, just to change the order in the list. I also don't need to change the data in the model, I only want the order to be different in the view.
I've been looking through the documentation, and it seems like I have to implement mimeTypes, mimeData, and dropMimeData, but this gets very complicated fast! Some of the data in my model is not actually displayed in the view, and like I said I don't want to change the order of data in the model. Is there a way to simply drag items to change their sorting (just like the headers are already able to do) without a huge amount of coding?
Updated for QT5 to remove deprecated methods
If you are using PyQT All you need to do for your requirements is this:
your_tableview.verticalHeader().setSectionsMovable(True)
your_tableview.verticalHeader().setDragEnabled(True)
your_tableview.verticalHeader().setDragDropMode(QAbstractItemView.InternalMove)
Then rinse and repeat with horizontalHeader if you want those rearrange-able too.
You are absolutely right, you shouldn't need to touch or even know what the model is for this functionality. This is further demonstrated by your proper use of the QSortFilterProxyModel decorator over the model itself.
The stuff you saw about mimeTypes and all of that stuff is for drag-and-drop of actual objects of varying sources from other windows/applications/desktop/etc and isn't needed for what you are trying to accomplish currently.