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

How to make combobox always show arrow

9 Answers 232 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lynne
Top achievements
Rank 1
Lynne asked on 10 Apr 2012, 02:43 PM
In the default configuration, combobox columns do not show an arrow to indicate that they are, in fact, comboboxes.  Our users find this confusing, and we would like to know how to make comboboxes always show an arrow, regardless of their focus state.

Would you please provide an example of how to do this?

Thanks,
-Lynne W

9 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 10 Apr 2012, 03:22 PM
Hi,

 You can use an ordinary GridViewDataColumn and place a ComboBox inside the CellTemplate of the column. That way you will always see the ComboBox no matter if the cell is in edit mode or not.

Please let me know if this would work in your case.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lynne
Top achievements
Rank 1
answered on 10 Apr 2012, 05:16 PM
I've tried doing that, but I'm clearly missing something about how the CellTemplate works, because each row's instance of the combobox column ends up taking on the value of the first item in the underlying CollectionViewSource, and updating a single row's EquipmentType then causes all items (each row's EquipmentType) in the CVS to get set to the the same value.

My grid is a list of devices, coming from a CollectionViewSource, and displays correctly

<telerik:GridViewDataColumn Name="colEquipmentType2">
    <telerik:GridViewColumn.CellTemplate>
     <DataTemplate>
      <ComboBox DisplayMemberPath="EquipmentTypeName"
                 ItemsSource="{Binding Source={StaticResource cviewEquipmentTypes}}"
                 SelectedValue="{Binding EquipmentType_EquipmentTypeId, Mode=TwoWay}"
                 SelectedValuePath="EquipmentTypeId"
                 SelectedItem="EquipmentTypeId" />
     </DataTemplate>
    </telerik:GridViewColumn.CellTemplate>
   </telerik:GridViewDataColumn>

If I use a regular GridViewComboBoxColumn (below), it displays correctly, albeit without the always-visible drop-down arrow.
<telerik:GridViewComboBoxColumn Name="colEquipmentType"
    DataMemberBinding="{Binding EquipmentType_EquipmentTypeId}"
    DisplayMemberPath="EquipmentTypeName"
    ItemsSource="{Binding Source={StaticResource cviewEquipmentTypes}}"
    SelectedValueMemberPath="EquipmentTypeId"
    UniqueName="EquipmentType" />

0
Dimitrina
Telerik team
answered on 12 Apr 2012, 09:41 AM
Hi,

 You should specify DataMemberBinding for the GridViewDataColumn. Do you export the value, selected from the ComboBox?

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lynne
Top achievements
Rank 1
answered on 12 Apr 2012, 02:36 PM
I don't know what you mean by, "export the value, selected from the ComboBox".

0
Dimitrina
Telerik team
answered on 12 Apr 2012, 02:41 PM
Hello,

 I have not understood what this sentence mean: "updating a single row's EquipmentType then causes all items (each row's EquipmentType) in the CVS to get set to the the same value". I suppose that you export the rows to CVS, is that correct?

Kind regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lynne
Top achievements
Rank 1
answered on 12 Apr 2012, 02:51 PM
This seems as though it should be straightforward.  I want the arrow on the combobox to always be visible, so that users know it's a combobox.  I don't want to change the basic UI paradigm of click-to-edit (by requiring an add'l function key press, for example).

Can this be done?  If so, do you have, or can you provide an example showing how to do it, please?
0
Vlad
Telerik team
answered on 12 Apr 2012, 02:59 PM
Hello,

 Are you looking for exporting example? Please check you local copy of our demos for more info.

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Lynne
Top achievements
Rank 1
answered on 12 Apr 2012, 03:12 PM
Which example in which demo?
0
Dimitrina
Telerik team
answered on 13 Apr 2012, 08:33 AM
Hello,

 I apologize for this misunderstanding. 

I have attached a sample project to show you what I meant in my first reply. Please check it and try to apply the same logic into your implementation. 

If you still get the mentioned problem, please send me a sample project via Support thread, so that we could check what the exact case is.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Lynne
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Lynne
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or