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

Clear selection button and strange dropdown

3 Answers 244 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 03 Feb 2010, 07:45 PM
Hi,

since search frustrates a bit I open a new thread.
First about search - ClearSelectionButtonVisibility finds one thread ClearSelectionButtonContent another one.
ClearSelectionButton - finds nothing!!! I love this^^ either I luckily enter the "perfect matching text" or I find nothing.

Anyhow - my problem (documentation doesn't even show something about this button) is that the button doesn't close the dropdown.
Scenario: the user can select an image and he should be able to select no image.
I did this with ClearSelectionButton... - and so far it works.
BUT - the dropdown stays open after I click this button.
When I select an item CB closes (as expected) which is OK.
But after the user selects "No image" (the ClearSelectionButton) he has to find a way to close the dropdown.

Since I build a silverlight application there is no code behind or something like this in the control where I use the CB.
The control is used in a (dynamic) template inside a templated control and the rest is done via databinding.

Next - I use a combobox near the bottom of my control. Of course the "dropdown" has to go upside.
What it does is:
a.) it still goes "down"
b.) it comes from the middle of my form (where later the top position will be)
c.) the "clear selected" button is on top of the dropdown - not near the combobox where I expect it.
f.) (the best) if there is not enough space above it drops over the combobox...

I also found no way to tell the combobox it's preferred drop-direction.
Here a simple page showing all the described "funny" things:
http://iphone.pp-p.net/ViewSettings.aspx

And here the markup
Snippet created with CBEnhancer
<Grid x:Name="LayoutRoot">
    <Grid.Resources>
        <DataTemplate x:Key="cbInner">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="310"/>
                    <RowDefinition Height="20"/>
                </Grid.RowDefinitions>
                <Image Width="240" Height="307" Source="{Binding TheImage}"/>
                <TextBlock Grid.Row="1" Text="{Binding ImageName}" HorizontalAlignment="Stretch"/>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="cbSelect">
            <TextBlock Text="{Binding ImageName}"/>
        </DataTemplate>

    </Grid.Resources>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="580"/>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <StackPanel Grid.Column="0" >
        <StackPanel HorizontalAlignment="Left">
            <telerikInput:RadComboBox SelectionBoxItemTemplate="{StaticResource cbSelect}" ItemTemplate="{StaticResource cbInner}" ItemsSource="{Binding BKGImages, Source={StaticResource bkgHolder}}" Height="25" Width="320" HorizontalAlignment="Center" MaxDropDownHeight="400" ClearSelectionButtonContent="No Image" ClearSelectionButtonVisibility="Visible"/>
            <Rectangle Height="226" Fill="Red"/>
            <Rectangle Height="326" Fill="Red"/>
            <telerikInput:RadComboBox SelectionBoxItemTemplate="{StaticResource cbSelect}" ItemTemplate="{StaticResource cbInner}" ItemsSource="{Binding BKGImages, Source={StaticResource bkgHolder}}" Height="25" Width="320" HorizontalAlignment="Center" MaxDropDownHeight="400" ClearSelectionButtonContent="No Image" ClearSelectionButtonVisibility="Visible"/>
        </StackPanel>
    </StackPanel>
    <StackPanel Grid.Column="1" >
        <StackPanel HorizontalAlignment="Left">
            <Rectangle Height="126" Fill="Red"/>
            <Rectangle Height="126" Fill="Red"/>
            <Rectangle Height="126" Fill="Red"/>
            <telerikInput:RadComboBox SelectionBoxItemTemplate="{StaticResource cbSelect}" ItemTemplate="{StaticResource cbInner}" ItemsSource="{Binding BKGImages, Source={StaticResource bkgHolder}}" Height="25" Width="320" HorizontalAlignment="Center" MaxDropDownHeight="400" ClearSelectionButtonContent="No Image" ClearSelectionButtonVisibility="Visible"/>
            <Rectangle Height="200" Fill="Red"/>
            <telerikInput:RadComboBox SelectionBoxItemTemplate="{StaticResource cbSelect}" ItemTemplate="{StaticResource cbInner}" ItemsSource="{Binding BKGImages, Source={StaticResource bkgHolder}}" Height="25" Width="320" HorizontalAlignment="Center" MaxDropDownHeight="400" ClearSelectionButtonContent="No Image" ClearSelectionButtonVisibility="Visible"/>
        </StackPanel>
    </StackPanel>
</Grid>

Regards
Manfred

3 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 09 Feb 2010, 07:40 AM
Hi Manfred,

Straight to the problems:
- The Clear button does not close the dropdown - this is by design. We will have to think about adding a way to control this behavior. The dropdown should be able to close if you click on the "arrow" button again, or outside the combo (the underlying element will not get the click event).
- Dropdown position is automatically chosen by the control and you cannot change it in the current version. It is always shown underneath the combo, if there is not enough space, it tries to display itself above, and if there is not enough space, the dropdown is shown on top, in order to display as much as possible of its height.

By the way, near the end of this article, there is a short paragraph about the Clear button:
http://www.telerik.com/help/silverlight/radcombobox-features-selection.html

I contacted the documentation team and they promised to move the text in a separate article as soon as possible.

Kind regards,
Valeri Hristov
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Edijs
Top achievements
Rank 1
answered on 29 Jul 2010, 11:09 AM
Hi!

Do you have any solution on the issue with "The Clear button does not close the dropdown - this is by design"?
It feels more natural that by design it should close automatically as it does when you select any of the items in combobox.

Thanks,
Edijs
0
Valeri Hristov
Telerik team
answered on 02 Aug 2010, 09:04 AM
Hello Edijs,

I cannot remember when exactly we changed the behavior of the Clear button, but the latest versions of RadComboBox close the dropdown when you click the button. Check our online demos for example.

Kind regards,
Valeri Hristov
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
Tags
ComboBox
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Valeri Hristov
Telerik team
Edijs
Top achievements
Rank 1
Share this question
or