This question is locked. New answers and comments are not allowed.
I've been experimenting with the RowDetailsTemplate, but I can't figure out how to stretch it's contents horizontally. More specifically I have a couple of textboxes that I want to stretch to the full width (minus som margins) of the rowdetails. I hope there is a solution that doesn't involve the sizechanged event to expand the textboxes.
4 Answers, 1 is accepted
0
Hello Jorn,
Greetings,
Milan
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.
You can stretch the content with a simple style:
<telerik:RadGridView.RowDetailsStyle> <Style TargetType="grid:DetailsPresenter"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> </Style> </telerik:RadGridView.RowDetailsStyle>Hope this helps.
Greetings,
Milan
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
George Felipe
Top achievements
Rank 1
answered on 07 Apr 2010, 10:17 PM
Hi,
I have attempted to add this style to my RadGridView and I get the following exception:
"Invalid attribute value grid:DetailsPresenter for property TargetType. [Line: 93 Position: 51]"
Am I doing something wrong? Where is the style suppose to go? And why isn't horizontal stretch the default behavior?
Here is my grid just incase.
I have attempted to add this style to my RadGridView and I get the following exception:
"Invalid attribute value grid:DetailsPresenter for property TargetType. [Line: 93 Position: 51]"
Am I doing something wrong? Where is the style suppose to go? And why isn't horizontal stretch the default behavior?
Here is my grid just incase.
| <telerikGrid:RadGridView x:Name="grdCustList" Grid.Column="1" AutoGenerateColumns="False" |
| IsReadOnly="True" IsFilteringAllowed="False" ShowGroupPanel="False" |
| SelectionChanged="grdCustList_SelectionChanged" RowDetailsVisibilityMode="VisibleWhenSelected" > |
| <telerikGrid:RadGridView.Columns> |
| <telerikGrid:GridViewDataColumn Header="ID" DataMemberBinding="{Binding CustID}"/> |
| <telerikGrid:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/> |
| <telerikGrid:GridViewDataColumn Header="City" DataMemberBinding="{Binding City}"/> |
| <telerikGrid:GridViewDataColumn Header="State" DataMemberBinding="{Binding State}"/> |
| <telerikGrid:GridViewDataColumn Header="Country" DataMemberBinding="{Binding Country}"/> |
| </telerikGrid:RadGridView.Columns> |
| <telerikGrid:RadGridView.RowDetailsStyle> |
| <Style TargetType="grid:DetailsPresenter"> |
| <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
| </Style> |
| </telerikGrid:RadGridView.RowDetailsStyle> |
| <telerikGrid:RadGridView.RowDetailsTemplate> |
| <DataTemplate > |
| <telerikNav:RadTabControl Width="Auto"> |
| <telerikNav:RadTabItem Header="Customer Info"> |
| <Grid Margin="10"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition/> |
| <ColumnDefinition/> |
| <ColumnDefinition/> |
| </Grid.ColumnDefinitions> |
| <StackPanel> |
| <TextBlock Text="General Info" FontWeight="Bold" HorizontalAlignment="Center"/> |
| <StackPanel Orientation="Horizontal" > |
| <StackPanel> |
| <TextBlock Text="Type:"/> |
| <TextBlock Text="Cust Group:"/> |
| <TextBlock Text="Market Seg:"/> |
| <TextBlock Text="Sub Cust ID:"/> |
| <TextBlock Text="Report Group:"/> |
| <CheckBox Content="Inactive" IsChecked="{Binding Inactive}" IsEnabled="False"/> |
| <CheckBox Content="Nat Acct" IsChecked="{Binding NationalAcct}" IsEnabled="False"/> |
| </StackPanel> |
| <StackPanel Margin="5,0,0,0"> |
| <TextBlock Text="{Binding CustomerType}"/> |
| <TextBlock Text="{Binding GroupDescription}" /> |
| <TextBlock Text="{Binding MarketSegment}" /> |
| <TextBlock Text="{Binding SubCustID}" /> |
| <TextBlock Text="{Binding ReportGroup}" /> |
| </StackPanel> |
| </StackPanel> |
| </StackPanel> |
| <StackPanel Grid.Column="1"> |
| <TextBlock Text="Location Info" FontWeight="Bold" HorizontalAlignment="Center"/> |
| <StackPanel Orientation="Horizontal"> |
| <StackPanel> |
| <TextBlock Text="Address:"/> |
| <TextBlock Text=" "/> |
| <TextBlock Text=" "/> |
| <TextBlock Text="City:"/> |
| <TextBlock Text="State:"/> |
| <TextBlock Text="Zip:"/> |
| <TextBlock Text="Country:"/> |
| </StackPanel> |
| <StackPanel Margin="5,0,0,0"> |
| <TextBlock Text="{Binding Address1}"/> |
| <TextBlock Text="{Binding Address2}" /> |
| <TextBlock Text="{Binding Address3}" /> |
| <TextBlock Text="{Binding City}" /> |
| <TextBlock Text="{Binding State}" /> |
| <TextBlock Text="{Binding Zip}" /> |
| <TextBlock Text="{Binding Country}" /> |
| </StackPanel> |
| </StackPanel> |
| </StackPanel> |
| <StackPanel Grid.Column="2"> |
| <TextBlock Text="Main Contact Info" FontWeight="Bold" HorizontalAlignment="Center"/> |
| <StackPanel Orientation="Horizontal"> |
| <StackPanel> |
| <TextBlock Text="Phone Num:"/> |
| <TextBlock Text="Fax Num:"/> |
| <TextBlock Text="E-Mail:"/> |
| <TextBlock Text="Sales Rep:"/> |
| </StackPanel> |
| <StackPanel Margin="5,0,0,0"> |
| <TextBlock Text="{Binding PhoneNum}"/> |
| <TextBlock Text="{Binding FaxNum}" /> |
| <TextBlock Text="{Binding EmailAddress}" /> |
| <TextBlock Text="{Binding SalesRepCode}" /> |
| </StackPanel> |
| </StackPanel> |
| </StackPanel> |
| </Grid> |
| </telerikNav:RadTabItem> |
| </telerikNav:RadTabControl> |
| </DataTemplate> |
| </telerikGrid:RadGridView.RowDetailsTemplate> |
| </telerikGrid:RadGridView> |
0
George Felipe
Top achievements
Rank 1
answered on 07 Apr 2010, 10:56 PM
Cancel that. I found how to do it via Expression Blend and this link:
http://www.telerik.com/help/silverlight/gridview-styling-row-details.html
http://www.telerik.com/help/silverlight/gridview-styling-row-details.html
0