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

Column width Fit to GridView

2 Answers 175 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kaushal
Top achievements
Rank 1
Kaushal asked on 18 Jul 2012, 06:10 PM
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 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 19 Jul 2012, 08:57 AM
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.

0
Kaushal
Top achievements
Rank 1
answered on 21 Jul 2012, 10:45 AM
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>


Tags
GridView
Asked by
Kaushal
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Kaushal
Top achievements
Rank 1
Share this question
or