4

I have a gridview with fixed width columns, and I want to enable vertical scrolling. The problem I am having is that when the scrollbar appears it overlaps the rightmost column (which is a currency value, causing the decimal part of the value to become hidden).

Is there a setting on GridViewColumn where I can set the column to a Auto width but have it automatically fill available space. Then when the scrollbar appears the column will just adjust its own width?

Here is my current XAML

<ListView IsSynchronizedWithCurrentItem="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="100">
        <ListView.View>
            <GridView AllowsColumnReorder="False" >
                <GridViewColumn Header="Payment" Width="220" CellTemplate="{DynamicResource DescriptionDataTemplate}"/>
                <GridViewColumn Header="Tip" Width="89" CellTemplate="{DynamicResource TipAmountDataTemplate}"/>
                <GridViewColumn Header="Total" Width="90" CellTemplate="{DynamicResource PayAmountDataTemplate}"/>
            </GridView>
        </ListView.View>
    </ListView>
Malcolm O'Hare
  • 4,879
  • 3
  • 33
  • 53

1 Answers1

0

Try using Width="*" in the GridViewColumn's width field.

Otherwise, you may have to adjust the other widths to be smaller, or explicitly set the width of the scroll view/grid view.

John Gardner
  • 24,225
  • 5
  • 58
  • 76