This is a migrated thread and some comments may be shown as answers.

Extend Last Column

6 Answers 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Simon Woods
Top achievements
Rank 1
Simon Woods asked on 22 Mar 2010, 05:52 PM
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

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 23 Mar 2010, 07:35 AM
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.
0
Simon Woods
Top achievements
Rank 1
answered on 23 Mar 2010, 10:08 AM
Excellent. Many thx
0
Murray
Top achievements
Rank 2
answered on 31 Aug 2012, 11:45 AM
Would there be a way to make this a property of the gridview itself? This would be great for autogenerating columns.
0
Maya
Telerik team
answered on 03 Sep 2012, 06:54 AM
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.

0
Murray
Top achievements
Rank 2
answered on 03 Sep 2012, 03:14 PM
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
0
Maya
Telerik team
answered on 04 Sep 2012, 08:49 AM
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.

Tags
GridView
Asked by
Simon Woods
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Simon Woods
Top achievements
Rank 1
Murray
Top achievements
Rank 2
Maya
Telerik team
Share this question
or