locked
Need to work out a ListView in ListLayout mode with variable height items + metro style app

    Question

  • How do I create a ListView with the ListLayout mode and with variable heights for elements(items)... 

    it is possible in grid layout by setting groupinfo property. But is it possible in Listlayout mode?   

    consider this as a list sms message and some messages are long and not possible to display in fixed height, so I want the item to change height accordingly...  How do I do that?


    Monday, May 28, 2012 8:14 AM

Answers

  • Finally I worked out it by adding divisions with custom heights for individual item and implemented like listview control's behavior.
    • Marked as answer by Dino He Monday, June 11, 2012 9:01 AM
    Monday, June 11, 2012 8:27 AM

All replies

  • Hi NagendraVivek,

    According to your description, this is a metro style application. I will move it to the Building Metro style apps with C# or VB Forum for better support.

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, May 30, 2012 6:13 AM
  • I would use a DataTemplateSelector for this. It allows you to select or create a data template for each individual list item. You find a working sample here.

    Wednesday, May 30, 2012 7:08 AM
  • hi Bob Wu-MT,Thanks for your quick reply

    I would like to prefer metro style apps using HTML5 - with java script, can you suggest by using that technologies?

    Thursday, May 31, 2012 10:40 AM
  • HI

    How did you set that property in your GridLayout?

    As far as I know WinJS.UI.ListLayout object also have the groupinfo property.

    Refer to :

    http://msdn.microsoft.com/en-us/library/windows/apps/br211751.aspx

    http://msdn.microsoft.com/en-us/library/windows/apps/br211792.aspx

    So I think you can do the same thing by using ListLayout.

    If you can't implement it in your project.

    Please past your GridLayout code here, I'll try to implement it in my PC.

    Thanks


    • Edited by Dino He Thursday, June 7, 2012 9:25 AM
    Thursday, June 7, 2012 9:18 AM
  • Finally I worked out it by adding divisions with custom heights for individual item and implemented like listview control's behavior.
    • Marked as answer by Dino He Monday, June 11, 2012 9:01 AM
    Monday, June 11, 2012 8:27 AM
  • I couldn't found any solution for the same by using WinRT list view with list layout mode,

    if any solution appreciated. the items should be arranged one by one in rows only, there should be one column that's it .

    Wednesday, June 13, 2012 8:55 AM
  • kindly share some code or elaborate more
    Monday, July 23, 2012 7:55 PM
  • yes I have done this by appending divs with custom properties(generally style properties we called) dynamically, first of all im measuring the content height to be show,then I will assign the height to the dynamic div height then again will do the same procedure for the next item.

    then we can add list view transitions using winjs animations

    Wednesday, September 5, 2012 10:21 AM