Textblock width in treeviewitem template

0 Answers 13 Views
TreeView
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 02 Apr 2024, 09:13 AM

Hi

I have the following datatemplate:

		<DataTemplate 
			x:Key="ReportComponentTemplate">
			<Grid>
				<Grid.RowDefinitions>
					<RowDefinition Height="*"/>
					<RowDefinition Height="30"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="30"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<CheckBox IsChecked="{Binding Included}" Margin="5,0"/>
				<TextBlock
					Grid.Column="1" Text="{Binding Didascalia}" HorizontalAlignment="Stretch"
					TextWrapping="Wrap"/>
				<t:RadComboBox Grid.Row="1" Grid.ColumnSpan="2"
					Width="150"
					Visibility="{Binding DataContext.TemplatePath, 
						RelativeSource={RelativeSource AncestorType=local:TreeViewReportControl},
						Converter={StaticResource StringEmptyToHide}}"
					VerticalAlignment="Top" Margin="5,0"
					HorizontalAlignment="Left"
					ItemsSource="{Binding TagsDisponibili}"
					SelectedItem="{Binding TagSelezionato, NotifyOnTargetUpdated=True, Mode=TwoWay}">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="SelectionChanged">
							<i:InvokeCommandAction Command="{Binding DataContext.TagSelezionatoUpdatedCommand
								, RelativeSource={RelativeSource AncestorType=local:TreeViewReportControl}}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</t:RadComboBox>
			</Grid>
		</DataTemplate>
This datatemplate is used as itemtemplate of a internal node of a radtreeview.
The Vsual tree is the following:

<t:RadDocking>
	<t:RadSplitContainer MaxWidth="600" t:DockingPanel.InitialSize="400,150" Name="LeftContainer" InitialPosition="DockedLeft">
		<t:RadPaneGroup>
			<t:RadPane>
				<Grid>
					<t:RadBusyIndicator>
						<t:RadTreeView>
						</t:RadTreeView>
					</t:RadBusyIndicator>
				</Grid>
			</t:RadPane>
		</t:RadPaneGroup>
	</t:RadSplitContainer>
</t:RadDocking>

Of course there are many other controls.
The strange here it is that textblock inside the row 1 of  ReportComponentTemplate systematically overflow the width of its parents.
I can set a fixed width or a maxwidth, but I want that it occupy the full available area (but not over).
Thank you
Luigi

Stenly
Telerik team
commented on 05 Apr 2024, 08:43 AM

May I ask if you could share an image that showcases the overlapping? Also, a sample project that reproduces this scenario will also be of help, so I can test it and provide suggestions based on the setup.

No answers yet. Maybe you can help?

Tags
TreeView
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or