Radexpander Makes my Itemscontrols buttons stop working

6 posts, 1 answers
  1. Mark
    Mark avatar
    5 posts
    Member since:
    Sep 2010

    Posted 18 Feb Link to this post

    I have a radexpander on a form that is meant to expand over a custom control.  The relevant WPF is:

     

                <Grid Grid.Column="2" Grid.Row="1" Margin="0,20,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="85*"/>
                        <RowDefinition Height="15*" MinHeight="50px"/>
                    </Grid.RowDefinitions>
                    <gsas:FullHourlyView Grid.Row="0"/>
                    <gsas:Legend Grid.Row="1" Margin="20,15,0,0" Visibility="{Binding LegendVisible, Converter={StaticResource BoolToVis}, FallbackValue=Visible}"/>
                </Grid>

                <telerik:RadExpander x:Name="expand" Grid.Column="2" Grid.Row="1" ExpandDirection="Up" VerticalAlignment="Stretch" VerticalContentAlignment="Bottom" HorizontalHeaderAlignment="Right" telerik:AnimationManager.IsAnimationEnabled="True" IsExpanded="{Binding AlarmGridExpanded, Mode=TwoWay}" Collapsed="expand_Collapsed" Expanded="expand_Expanded" ToolTip="Show Alarms">
                    <ContentControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="{Binding AlarmsGrid}"></ContentControl>
                </telerik:RadExpander>
            </Grid>

    The FullyHourlyView is made up of four other custom controls, the relevant bit being:

                   <ItemsControl ItemsSource="{Binding HourData}" x:Name="HourBlocks">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="-1,0,-3,0"  Command="{Binding ElementName=HourBlocks, Path=DataContext.HourlyClick}" CommandParameter="{Binding}">

    There are a couple of behaviors I now have to do with the radexpander being on there.  

    1) The buttons do not fire, in fact that appear to be disabled or something like that because when you hover over it they do not highlight like they do when I remove the radexpander from the WPF.

    2) The tooltip for the buttons is the same as the Tooltip for the RadExpander (Show Alarms).

    If I remove the expander everything works as I would expect.

     

  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 18 Feb Link to this post

    Hello Mark,

    We have tried to reproduce the reported behavior, but with no success. The RadExpander does not treat or modify its content in any matter that is why we think that the issue might be caused the xaml setup. That is why we would like you to provide us with a sample project reproducing the issue in order to provide investigate further.

    Looking forward to hearing from you.

    Kind regards,
    Kiril Vandov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mark
    Mark avatar
    5 posts
    Member since:
    Sep 2010

    Posted 19 Feb in reply to Kiril Vandov Link to this post

    Kiril,

    I have an example, how do I get it to you?

  5. Mark
    Mark avatar
    5 posts
    Member since:
    Sep 2010

    Posted 19 Feb Link to this post

    Kiril,

    I can get it to do it with just this:

    <Window
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:t="clr-namespace:TestItemsControlButton"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="TestItemsControlButton.MainWindow"
            Title="MainWindow" Height="350" Width="525"
            >
        <Grid>
            <Button Height="50"></Button>
            <telerik:RadExpander x:Name="expand" Grid.Column="2" Grid.Row="1"  ExpandDirection="Up" VerticalAlignment="Stretch" VerticalContentAlignment="Bottom" HorizontalHeaderAlignment="Right" telerik:AnimationManager.IsAnimationEnabled="True" IsExpanded="{Binding AlarmGridExpanded, Mode=TwoWay}" ToolTip="Show Alarms">
            </telerik:RadExpander>
        </Grid>
    </Window>

  6. Answer
    Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 22 Feb Link to this post

    Hello Mark,

    If the attached code-snippet is a copy of your code a the issue is that you cant click on the button marked with Height="50", it is expected let me explain why. You have defined a Grid in which you are defining a Button and on top of it a RadExpander, as the RadExpander does not have background set by default you are able to see the button below it (that does not make it clickable). You will reproduce that behavior with all MS controls too, you can try to use the MS Expander and reproduce the behavior. If you want to display the button and the Expander and keep their interaction you will need to define them in different Grid Columns\Rows depends on your UI preferences.
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Button Height="50"></Button>
        <telerik:RadExpander x:Name="expand"  Background="Orange"
                             Grid.Column="2"
                             Grid.Row="1" 
                             ExpandDirection="Up"
                             VerticalAlignment="Stretch"
                             VerticalContentAlignment="Bottom"
                             HorizontalHeaderAlignment="Right"
                             telerik:AnimationManager.IsAnimationEnabled="True"
                             IsExpanded="{Binding AlarmGridExpanded, Mode=TwoWay}" ToolTip="Show Alarms">
            <local:UserControl1 />
        </telerik:RadExpander>
    </Grid>
    I hope this information helps.

    Kind regards,
    Kiril Vandov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  7. Mark
    Mark avatar
    5 posts
    Member since:
    Sep 2010

    Posted 22 Feb in reply to Kiril Vandov Link to this post

    Kiril, 

    That was it, thank you.

Back to Top
UI for WPF is Visual Studio 2017 Ready