windows 8 app page that has list and details - windows-8

I am now designing a page for a windows 8 app.
the page has 2 parts, the left part will be like a list, when user select one item in the list, the right part will show the content based on the selection.
but I want to select different item in the left will display the different data in the right. For example, maybe select first item in the list, some text blocks will display on the right. select second item , an image will display on the right.
the data in the behind is a class which has some properties. I just want show this properties based on the selection in the list
so how to implement this? anyone has any idea?
thanks!

In the item template, create controls in separate panels for each different data type: text, image, video, etc. Then you can use a converter on each panel to inspect the data that it is bound to and show/hide the panels where appropriate. Depending on your data source, you might be evaluating either the class type or a property that contains an enumerated value that reveals the type, or maybe some more complex evaluation of the state of the class's properties.

One of the templates that comes with Visual Studio Express for Windows 8 supports this list and details view - look at the Split App template.
For more information, see:
http://msdn.microsoft.com/en-us/library/windows/apps/hh738343.aspx

Related

Hide few fields in EditForm.asx of Picture Library in sharepoint 2010

I have a picture library and added few fields to it. When i click add new item from picture library, the EditForm.aspx appears after uploading the picture. This form contains many fields of which I want to hide Title, Date Picture Taken, Description, and Keyword. In short the EditForm should contain only Name, Preview and the columns that I have added. Is it possible to hide the other columns? I want to perform this out of the box.
Several possibilities.
You can use SharePoint Designer to manipulate the NewForm, EditForm and DisplayForm. Edit the existing form, use CSS to set the out of the box HTML form to hidden, then add a new custom form to the page and remove the columns you don't want to see.
If you don't want to use these columns at all, just delete them in the Library settings
If you don't want to delete the columns, click the parent content type in the Library settings, then edit each column and set it to "hidden"
Check this out: http://sarangasl.blogspot.in/2009/10/hide-column-in-edit-new-or-display-mode.html
I found this solution to be really simple and effective. Very well documented and descriptive.

How can a custom web part read the list item fields in a display/edit form?

I need to create a custom web part and programmatically attach to the display and edit forms of a list. The web part is meant to display some information (coming from another list) about the list item being displayed on the form.
I know how to add the web part to the list programmatically, but I'm having an issue trying to get the web part to read the list item being displayed on from. I know the SPForm object exposes its parent list but I cannot or don't know how to convert the form to an SPForm object. The parent of the web part is the web part manager and the parent of that is the HTML form object. But when I try convert that to an SPForm object it throws an error.
Also, even if I manage to get hold of the SPForm and its parent list, how can I get hold of the list item being displayed?
Please bear in mind that I need to avoid overwriting the default forms as it will significantly increase the development time.
Any help or idea is appreciated.
Regards

Windows 8 GridView - show two items per time

I need to implement a sort of book using the GridView Control.
In particular I'm looking for a way to display only 2 items per time and still to be able to scroll the whole list using scrollbars.
Your question isn't very clear, but I'm assuming you are asking how to ask 2 rows or columns of blocks to your application.
Have a look at the default new Metro app template. It's hub page has a multi-line gridview. The key is to use a WrapGrid, or VariableSizedWrapGrid to display your items. In the example, a gridview is used, but then the wrapgrid is used as the item template (used for each group of items).

Best way to select from a list - aren't the two listboxes getting a little old?

How many times have we seen this type of selector:
List Box Selector http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/MoveItemsListBox.jpg
I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.
I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around.
Has anyone seen an open source project like this?
If a CheckListBox won't suffice (and it usually will), then the "modern" approach would be to use a ListView or similar component with a "Transfer" column. Render the button inline in that column, one for each row, so that it only takes one click to move an item from one to the other.
You see this everywhere in Vista, usually with hyperlinks as opposed to buttons. Instead of clicking on an item and then choosing an action, you click the action at the item level.
I wouldn't go overboard with slickness as it can impair functionality, but the dual-listbox screen is definitely old-school.
Also, if there's a very large amount of data to manage, it helps to provide a progressive search at the bottom of one or both lists.
I have done this type of selection using (essentially) a single CheckListBox that displays each item as an image. Part of the image looks like a LED, which is on (bright) if the item is selected or off (dark) if it is not selected.
This works well if you have a reasonable amount of data to select from, and also works well in a multi-column format if you can predict that the options will have reasonably similar lengths.
Allow users to drag items in/out of list 2, and also drag to reorder in list2.
(All items dragged out of list2, and dropped anywhere outside the list, get put back into list 1, in their correct place in the list by alphabetical or natural order.)
You can merge the two list boxes into one with the help of groups (LVGF_GROUPID flag): one group for selected and one for not selected.
You can also implement group membership changes with drag-drop between them. This way single drag-drop can move an item into the other group at the appropriate position, saving most/all of the other buttons.
Additionaly the bottom of each group can have one pseudo item with help text (i.e. "Drag items here to...") that is visible only when relevant.

2 column table presentaion control, like the properties window in the dev environment

in a windows form if i want to duplicate the properties window layout on my form, which is basically a 2 column table with title on the left and value on the right, what control do i use to achieve that?
A DataGridView component can be used to achieve a similar visual style and functionality, though it is not exactly the same.
To add columns, click the Smart Tag and change the settings, click "edit columns", and you know the rest.
If you want the exact same functionality as the properties window, and let your users edit the properties of an object, you can use the Properties control.