Column width Fit to GridView

3 posts, 0 answers
  1. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 18 Jul 2012 Link to this post

    Hi,

    Here I have problem to set width of last column of gridview. My Grid view is Fit to screen and second column cosume the space according to the content. Actually I need to set column stretch till gridview.

    Telerik.Windows.Controls Version    :  2012.1.326.1040
    Telerik.Windows.Controls.GridView  : 2012.1.326.1040

    Please refer the attached screen shot for more details.

    Regards,

    Kaushal Jani 
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Jul 2012 Link to this post

    Hello,

     I would suggest you to check this help article for a reference on how to achieve your goal.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 21 Jul 2012 Link to this post

    Hi,

    First of all thanks Didie. Here I have applied same thing in my solution but still problem persist. Here I am sending you my grid structure so that you can check it once.

    Thank you.
    <telerik:RadGridView AlternationCount="2"  Grid.Row="1"  HorizontalAlignment="Stretch" x:Name="dgdUser" CanUserFreezeColumns="False" IsReadOnly="{Binding GridView}" Visibility="{Binding ShowUser}" AutoGenerateColumns="False"  VerticalAlignment="Stretch"   ShowGroupPanel="False"   RowIndicatorVisibility="Collapsed">
                                                <telerik:RadGridView.Columns>
                                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"  Header="Name">
                                                    <telerik:GridViewDataColumn Header="Effective From"  DataMemberBinding="{Binding EffectiveFrom}"  MinWidth="140">
                                                        <telerik:GridViewDataColumn.CellTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadDateTimePicker  Width="123" x:Name="rdEffectiveFrom" InputMode="DatePicker" SelectedDate="{Binding Path=EffectiveFrom, Mode=TwoWay}"   HorizontalAlignment="Left"/>
                                                            </DataTemplate>
                                                        </telerik:GridViewDataColumn.CellTemplate>
                                                    </telerik:GridViewDataColumn>
                                                    <telerik:GridViewDataColumn Header="Effective To" DataMemberBinding="{Binding EffectiveTo}" Width="150">
                                                        <telerik:GridViewDataColumn.CellTemplate>
                                                            <DataTemplate>
                                                                <telerik:RadDateTimePicker  Width="123" x:Name="rdEffectiveTo" InputMode="DatePicker" SelectedDate="{Binding Path=EffectiveTo, Mode=TwoWay}"   HorizontalAlignment="Left"/>
                                                            </DataTemplate>
                                                        </telerik:GridViewDataColumn.CellTemplate>
                                                    </telerik:GridViewDataColumn>
                                                </telerik:RadGridView.Columns>
                                            </telerik:RadGridView>


Back to Top