Extend Last Column

7 posts, 0 answers
  1. Simon Woods
    Simon Woods avatar
    10 posts
    Member since:
    Dec 2009

    Posted 22 Mar 2010 Link to this post

    Hi

    I'm just starting to learn the silverlight gridview control. Coming from a winforms background I was used to setting a property ExtendLastColumn=True and the rightmost column would resize automatically to fill the width of the grid which remains after all other columns have been added.

    I'm looking to emulate that sort of behavior with the GridView control, but I'm struggling to work out how to implement it.

    Any pointers or tips would be very gratefully received

    Many thx

    Simon
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 23 Mar 2010 Link to this post

    Hi Simon,

    You can set Width="*" for the last column to achieve this.

    Regards,
    Vlad
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Simon Woods
    Simon Woods avatar
    10 posts
    Member since:
    Dec 2009

    Posted 23 Mar 2010 Link to this post

    Excellent. Many thx
  5. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 31 Aug 2012 Link to this post

    Would there be a way to make this a property of the gridview itself? This would be great for autogenerating columns.
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Sep 2012 Link to this post

    Hello Murray,

    Generally, you can set ColumnWidth property of the grid to "*", which will make the columns to be sized so that all the available space is taken. Another possible way to go  would be to handle AutoGeneratingColumn and set the Width property of the column you want.


    Greetings,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 03 Sep 2012 Link to this post

    That won't do what we needed but I found a visual workaround. I modified the template for the grid cell and header cell. By default you have the left border at zero and right border at 1px. I made the left 1px and right 0px. That way you still have borders between columns but the end column has no right border and visually looks like it fills the available space. I highly recommend you do the same modification to your template to help calm the posts I mentioned above. Thanks
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 04 Sep 2012 Link to this post

    Hello Simon,

    I am really glad that you have found a workaround appropriate for your exact scenario. We will consider your suggestion, but changing style and templates is breaking change which is not something we would rather to do. Nevertheless, thank you for your feedback and the solution you provided to the community. 

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner