Answered Does the GridView have a notion of columns?

Semua Balasan

  • 16 April 2012 2:39
    Moderator
     
     Jawab

    Hi benaw,

    GridView doesn't have columns. And currently we don't have a DataGrid-like control in xaml.

    If you do need to display data in a table, I suggest to carefully arrange the elements in items to make cells looks like in the same column.

    See a similar discussion in this thread.

    Best regards,


    Min Zhu [MSFT]
    MSDN Community Support | Feedback to us

  • 16 April 2012 6:35
     
     

    Why isn't there a DatGrid control?

  • 16 April 2012 11:54
     
     
    DataGrid and ComboBox controls are mouse-and-keyboard oriented, and hence touch-unfriendly. You can easily get the same functionality using GridViews (with tiles instead of rows) and CarouselPanels. I posted an example here.
  • 16 April 2012 13:03
     
     

    I see pictures not a grid in the link.

    This illustrates a confusion over use of Windows 8 and it's Metro UI.  This argument would be a hard sell to many financial organization who would benefit from the mobility and security aspect of Windows 8 OS but would want to see well formatted, aligned column based text and numerical data. You probably would not want much touch anyway as it is display.

  • 16 April 2012 16:31
     
     

    Imho, you should make maximum use of the basic Metro design principles, and the corresponding signature controls (tiles, horizontal scrolling, semantic zoom, etc.). On the other hand, I totally agree with you that some parts of some applications still require an Excel-look; the Finance App Preview also has pages that look like tables. Now, formatting and aligning can be done through templating the standard controls, so I guess there's no real need for a Datagrid control.

     Anyway, it will be a challenge to come up with a grid that looks decent in landscape, portrait, ànd snapped state.

  • 16 April 2012 17:19
     
     

    I agree with this approach to control choice approach first, however in my experience of tabular data and XAML DataGrids, they vary enormously in terms of their feature API and performance, this is because it tends not to be just a matter of simple templates but include optimizations. The Finance App Preview illustrates my concerns.  I am using a new high spec development laptop and scrolling the list of interest rate products I'm getting discernible display flicker with little data, not a fluid scroll.

    The snapped state would only require a summary is likely not to display tabular data being 320 TPI.  The view the orientation, I don't see as an issue, one approach would be to display less columns or a page that may be pannable as in the example, however an off topic point.

    The same is true for JavaScript implimentations.

  • 16 April 2012 19:26
     
     
    I would expect 3rd party control providers will jump on the chance to fill this need, but for now you are on your own. 
  • 16 April 2012 20:41
     
     

    Is this your opinion, or do you work for Microsoft?

  • 16 April 2012 21:29
     
     

    opinion, although I don't see why it matters, absence of DataGrid control in metro xaml is the fact.

    One thing to consider. If all you want is to show some data in columns you could style GridView to show groups using StackPanel instead of WrapGrid, ie. groups will become columns.  

  • 16 April 2012 21:47
     
     

    thanks for the thoughts, I suspect me like a lot of other people are doing a gap analysis to evaluate whether certain projects would be suitable to build as a Metro app or to wait until the desktop development in Windows 8 becomes better understood, or to stick to the devil you know WPF, Silverlight, html/js.. or iPad/PhoneGap development..

    It would not be the first time we invested time in a technology only find it was not delivered sufficient to meet a customer need, or there was a sudden shift and development is stopped on an existing one.