Creating a table with Silverlight for Windows Phone 7

前端 未结 3 453
名媛妹妹
名媛妹妹 2020-12-10 22:57

I\'d like to create a table on WP7. This is my current approach using a ListBox with a Grid as the data template.



        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 23:43

    This is a tricky problem! In WPF there exists the concept of a SharedSizeGroup, which allows you to share column widths across multiple grids, but this is not available in silverlight.

    There are a few workarounds on the web:

    http://www.scottlogic.co.uk/blog/colin/2010/11/using-a-grid-as-the-panel-for-an-itemscontrol/

    http://databaseconsultinggroup.com/blog/2009/05/simulating_sharedsizegroup_in.html

    Although neither are simple solutions.

    You might also try Mike's AutoGrid:

    http://whydoidoit.com/2010/10/06/automatic-grid-layout-for-silverlight/

提交回复
热议问题