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

Grid view 100% and Autoformatting columns

6 Answers 110 Views
GridView
This is a migrated thread and some comments may be shown as answers.
madladuk
Top achievements
Rank 2
madladuk asked on 07 Jul 2010, 04:50 PM
Hi, how do you get the gridview to take all available space when using the autogenerate columns. Also I found that it adds the extra blank column which is sorted by setting the column width to "*" however this cant be done when using autogenerate.

Thanks
P

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Jul 2010, 07:49 AM
Hello madladuk,

Generally columns generation is not related to this. The grid will take all available space without need to set any properties. Can you provide more info about your scenario? Screenshot will be appreciated as well.  

Best wishes,
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
madladuk
Top achievements
Rank 2
answered on 09 Jul 2010, 09:52 AM
Screen shot attached. As you can see the grid does not fit the full width of the tile and you have an extra column on the right hand side.

 

 

 

<Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch">

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="*" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<telerik:RadGridView x:Name="radGridView1" AutoGenerateColumns="True" Margin="5" Grid.Row="1" HorizontalAlignment="Stretch"

 

 

 

/>

 

 

 

 

<TextBlock Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Center"

 

 

 

Foreground="Black" FontFamily="Arial" Margin="5" x:Name="tbTitle" >

 

 

 

 

 

</TextBlock>

 

 

 

 

</Grid>

 

0
Vlad
Telerik team
answered on 09 Jul 2010, 10:18 AM
Hello madladuk,

 Actually this is not extra column - just rows measured to the end of the grid. You can remove this if you set ColumnWidth="*" for the grid or set Width="*" for the last grid column. To access auto-generated columns you can use AutoGeneratingColumn event. 

All the best,
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
madladuk
Top achievements
Rank 2
answered on 12 Jul 2010, 12:54 PM
Thanks, well this will sort out the columns in the gird however the main problem is the gridview filling the full width of the grid. Can you give me some pointers.
0
madladuk
Top achievements
Rank 2
answered on 12 Jul 2010, 01:31 PM
Okay sorted it, my main grid did not have the alignments setup as "stretch"

Thanks
P
0
Kaushal
Top achievements
Rank 1
answered on 18 Jul 2012, 05:00 PM
Hi madladuk,

I am facing issue to stretch last column till grid width so if you have proper implemented answer then please share over here.
Thanking you,

Kaushal Jani
Tags
GridView
Asked by
madladuk
Top achievements
Rank 2
Answers by
Vlad
Telerik team
madladuk
Top achievements
Rank 2
Kaushal
Top achievements
Rank 1
Share this question
or