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

IsReadOnly does seem to work

10 Answers 1565 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 18 Nov 2009, 04:00 PM
Hi..
I set

IsReadOnly

= true  , in code

But I can still change the values and select other items.
How do I lock the combo box ?  Any idea what I'm doing wrong?
thanks

10 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 18 Nov 2009, 04:11 PM
Hi Jon,

Just like the standard WPF ComboBox, IsReadOnly has effect only when IsEditable = true, but does not prevent the user from selecting values - it just makes the editable text box read-only. To completely prevent the control from selection you should use IsEnabled = false.

Greetings,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jon
Top achievements
Rank 1
answered on 18 Nov 2009, 04:26 PM
Hi..
When I change the IsEditable = false - the controls are barely visible.
How can I 'keep' the same style - but just 'lock them down'?

thanks again
0
Teodor
Telerik team
answered on 24 Nov 2009, 09:22 AM
Hi Jon,

We are sorry for the delay in our reply.

As far as I understand, you need your combo box to be displayed normally, but behave as it is not enabled (i.e. as if IsEnabled="False"). If so, you can use set the IsHitTestVisible property to False. Thus it will not respond to user input.

Let me know if this workaround works for you. 

Kind regards,
Teodor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jon
Top achievements
Rank 1
answered on 24 Nov 2009, 12:59 PM
Yes.. that will work.. thanks...

What is the purpose of IsHitTestVisible ?
0
Teodor
Telerik team
answered on 27 Nov 2009, 08:31 AM
Hello Jon,

In two words, when you set IsHitTestVisible to false, the mouse related events are not received by the control. For example, the control does not receive notification that the mouse is moved or clicked. Find more information on this matter here.

Hope this helps. Get in touch with us should you need more support.

Sincerely yours,
Teodor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hugo Aristizabal
Top achievements
Rank 2
answered on 18 Jan 2010, 05:07 PM
Hi. You say that with IsHitTestVisible set to false, the control will not respond to mouse events. But can the user still select a value with the keyboard (pressing tab until focusing in the ComboBox) and then pressing the Down key?

Thanks.
0
Hugo Aristizabal
Top achievements
Rank 2
answered on 18 Jan 2010, 05:17 PM
Well, I actually tried it, and the user could still select a valur with the keyboard. What I did was set the IsTabStop property to false as well, and it worked.
0
HARI
Top achievements
Rank 1
answered on 05 Jul 2016, 02:24 AM

HI All,

i have similar requirement . i am using RadComboBox and inside using checkbox.

when checkboxes are selected then cheboxes selected value need to display in combobox. it is displaying currently . but when we move next control then selected value not displaying. Please help on this.

 

 <telerik:RadComboBox HorizontalAlignment="Left" 
                                                     x:Name="cmbCategory"
                                                     Width="350" 
                                                     ItemsSource="{Binding ProcessNames,Mode=TwoWay}" Text="{Binding SelectedProcessName,Mode=TwoWay}" IsEditable="True" IsReadOnly ="True"
                                                     Grid.Column="1" >
                                                <telerik:RadComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel Orientation="Horizontal">
                                                            <CheckBox Name="BusinessProcessName" Content="{Binding CheckProcessNames,Mode=TwoWay}"  IsChecked="{Binding IsSelected,Mode=TwoWay}">
                                                              
                                                            </CheckBox>
                                                           </StackPanel>
                                                    </DataTemplate>
                                                    
                                                </telerik:RadComboBox.ItemTemplate>
0
HARI
Top achievements
Rank 1
answered on 05 Jul 2016, 02:25 AM

HI All,

i have similar requirement . i am using RadComboBox and inside using checkbox.

when checkboxes are selected then cheboxes selected value need to display in combobox. it is displaying currently . but when we move next control then selected value not displaying. Please help on this.

0
Polya
Telerik team
answered on 07 Jul 2016, 11:41 AM
Hi Hari,

You can use the TextSearch.TextPath property of the RadComboBox which will display the chosen property of the SelectedItem in the text box. That said, you should change the SelectedItem when the IsSelected property changes and add this in the RadComboBox:

TextSearch.TextPath="CheckProcessNames"

Hope this helps.

Regards,

Polya
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
yair torkeltaub
Top achievements
Rank 1
commented on 22 Nov 2021, 04:11 PM

you can inherits the combo to CombEx

override OnPreviewKeyDown  - if (IsReadOnly &&  e.Key!=Key.Tab ) e.Handled=True and then  Return

and Override  

OnIsDropDownOpenChanged(Bool oldValue,Bool newValue)

if(IsReadOnly==True) NewValue=False;

    Return
Tags
ComboBox
Asked by
Jon
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Jon
Top achievements
Rank 1
Teodor
Telerik team
Hugo Aristizabal
Top achievements
Rank 2
HARI
Top achievements
Rank 1
Polya
Telerik team
Share this question
or