How can set elements visibility?

0 Answers 30 Views
ComboBox
Jae Myoung
Top achievements
Rank 1
Jae Myoung asked on 22 Dec 2022, 06:39 AM | edited on 22 Dec 2022, 08:28 AM
When Program start, RadComboBox is Collapsed. 'cbType' RadComboBox item select, not visible. Why RadComboBox not visible?
<Control.Template>
	<ControlTemplate TargetType="{x:Type Mods_UiMod_FrameControls:UiFrameContent}">
		<StackPanel x:Name="Part_MainStack" DataContext="{Binding}">
			<telerik:RadComboBox Grid.Row="3"
								 Grid.Column="1"
								 Height="20"
								 Margin="5 0 5 0"
								 DisplayMemberPath="CODE_NAME"
								 FontSize="11"
								 ItemsSource="{Binding Source=
								 {x:Static Public_Code:CommonCodes.FormTypes}}"
								 SelectedIndex="{Binding SelectedIndexForm,
								 UpdateSourceTrigger=PropertyChanged}"
								 SelectedValuePath="CODE_ID"
								 SelectionBoxTemplate="{StaticResource CodeCBTemplate}"  
								 x:Name="cbType"/>
			<Label Grid.Row="4"
				   Grid.Column="0"
				   Content="Create Month"
				   FontSize="11"
				   Foreground="White" Name="lbCreateMonth">
				   <Label.Style>
					   <Style TargetType="Label">
						   <Setter Property="Visibility" Value="Collapsed"/>
						   <Style.Triggers>
								<DataTrigger Binding="{Binding ElementName=cbType, Path=SelectedIndex}" Value="0">
									<Setter Property="Visibility" Value="Visible"/>
								</DataTrigger>
						   </Style.Triggers>
					   </Style>
				   </Label.Style>
			</Label>
			<telerik:RadComboBox Grid.Row="4"
								 Grid.Column="1"
								 Height="20"
								 Margin="5 0 5 0"
								 DisplayMemberPath="CODE_NAME"
								 FontSize="11"
								 ItemsSource="{Binding Source={x:Static Public_Code:CommonCodes.TimeMonthCodes}}"
								 SelectedIndex="{Binding SelectedIndexCreateMonth,
														 UpdateSourceTrigger=PropertyChanged}"
								 SelectedValuePath="CODE_ID"
								 SelectionBoxTemplate="{StaticResource CodeCBTemplate}" Name="cbCreateMonth">
				<telerik:RadComboBox.Style>
					<Style TargetType="{x:Type telerik:RadComboBox}">
						<Setter Property="Visibility" Value="Collapsed"/>
						<Style.Triggers>
							<DataTrigger Binding="{Binding ElementName=cbType, Path=SelectedIndex}" Value="0">
								<Setter Property="Visibility" Value="Visible"/>
							</DataTrigger>
						</Style.Triggers>
					</Style>
				</telerik:RadComboBox.Style>
			</telerik:RadComboBox>
		<StackPanel x:Name="Part_MainStack" DataContext="{Binding}">
	</ControlTemplate>
</Control.Template>

Martin Ivanov
Telerik team
commented on 23 Dec 2022, 09:42 PM

I would suggest you to check the Missing Controls in the UI article that describes possible reasons why Telerik controls are not displayed in the view.
Jae Myoung
Top achievements
Rank 1
commented on 26 Dec 2022, 01:03 AM

Oh my god! Thanks you. insert BasedOn Property and resolved this problem.

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Jae Myoung
Top achievements
Rank 1
Share this question
or