Grid - column headers?

BradThomasBradThomas USMember, University ✭✭

Is it possible to add a column header to a grid within a listview? Or, should I look at using a tableview instead?

Posts

  • ChaseFlorellChaseFlorell CAInsider, University mod
    edited September 2015

    A listview is a "view" and will allow you to add headers to it.

    A grid is a "layout" and doesn't have a notion of headers, footers, etc. But you can add whatever you like to a Grid since it's just a layout.

  • BradThomasBradThomas USMember, University ✭✭

    Can a listview have multiple columns?

  • ChaseFlorellChaseFlorell CAInsider, University mod

    Can a listview have multiple columns?

    No.

    It sounds like what you want is a GridView... Which doesn't exist out of the box. There are a number of people (including myself) who have written a GridView custom renderer. I would say mine is super basic, but works. If you need a truly bindable GridView, I suggest taking a look at @GeorgeCook 's Implementation of the xlabs gridview.

  • BradThomasBradThomas USMember, University ✭✭

    Thanks Chase. No wonder I couldn't find any documentation on it. lol I'll take a look at what he came up with and see if I can get it going.

  • BradThomasBradThomas USMember, University ✭✭

    One follow up question - does this work with a PCL project?

  • ChaseFlorellChaseFlorell CAInsider, University mod

    Yep, that's the idea. You have platform specific renderers that are registered with your Forms application. Then you reference it in the shared lib.

  • BradThomasBradThomas USMember, University ✭✭

    Thanks man. I'm very much new to Xamarin, and also just a junior developer, so my head is spinning right now. lol

  • ChaseFlorellChaseFlorell CAInsider, University mod

    NP, that's exactly what we're all here for. The community is here to help.
    Also, as I just read today, they're working hard on getting documentation updated. Definitely check it out, there's gold in there.

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    You can create a viewcell and add a grid to a viewcell.

  • BradThomasBradThomas USMember, University ✭✭

    Thanks so much for your help @ChaseFlorell. I may have some additional questions if I can't figure out how to implement this.

    @AlessandroCaliaro - thanks! I'll check that out if I stumble too much on figuring out this implementation.

  • BradThomasBradThomas USMember, University ✭✭
    edited September 2015

    @ChaseFlorell Is there a simple example of using that to create a gridview and binding it to a datasource?

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭
    edited October 2015

    I don't know about the XLabs GridView, but I can recommend the DevExpress Grid.
    It's available on the component store for free. It has more features than anybody would ever need (not necessarily those YOU need :smiley: ) and a sample project which shows how to use most of them.

  • BradThomasBradThomas USMember, University ✭✭

    @MichaelRumpler - thanks for pointing that out. I have worked with DevExpress in all of our other applications, so I'll check it out. Thanks!

  • BradThomasBradThomas USMember, University ✭✭

    After adding the DevExpress grid, I've gotta say - that works perfectly!

Sign In or Register to comment.