Click here to Skip to main content
16,018,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am populating a grdiview in wpf

Check the image below

http://postimg.org/gallery/2n8yhoubi/ab28f5ae/

But the gridview align is not proper how can i make to fit properly.

HTML
<Grid Visibility="Visible" HorizontalAlignment="Stretch" Margin="5,5,5,0" x:Name="gdvDiagnosis" Width="Auto"
      Grid.Column="1" Grid.Row="4" ScrollViewer.CanContentScroll="True"
      ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="Auto" VerticalAlignment="Stretch" Grid.RowSpan="2">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="0*"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="0*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="0"/>
        <RowDefinition Height="0.43*"/>
        <RowDefinition Height="8.071"/>
        <RowDefinition Height="0.485*"/>
        <RowDefinition Height="0.085*"/>
    </Grid.RowDefinitions>
Posted
Updated 29-Sep-14 0:41am
v3

1 solution

You have not explicitly defined width, so it is taking as much as space it requires. You can explicitly define column width in ColumnDefinition.
 
Share this answer
 
Comments
chandra sekhar 6-Oct-14 2:37am    
How can i give it explicitly?
Imran_Hasan 6-Oct-14 8:36am    
You can explicitly set column width 120 in ColumnDefinition.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900