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

[Solved] Disable rcbReadOnly CSS

6 Answers 295 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 04 Aug 2009, 02:44 PM
Hi,

I want to disable the rcbReadOnly css class so that all combo boxes look the same - what's the best way of approaching that?

I'm finding the problem on a combo box with a tree shown inside it - theme I'm using is Web20.

Regards,

Jon

6 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 07 Aug 2009, 12:31 PM
Hello Jon,

Thank you for contacting us.

There are several ways of doing that. The easiest way is to add this OnClientLoad handler to every RadComboBox:
function clientLoad(sender) {
    $telerik.$('.rcbReadOnly', sender.get_element()).removeClass('rcbReadOnly');
}

It has a downside though - the Comboboxes will first appear normal and then will become what you want.

Another way is to use external skin which derives from the one you use - just get the Web20 skin from the hotfix archive and remove every CSS style that has rcbReadOnly in it - that should be enough.

Let me know how it goes.

Greetings,
Kamen Bundev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 07 Aug 2009, 04:04 PM
Hi Kaman,

Thanks for the reply.

I just tried this but the event doesn't fire for some reason.  Having the tree inside the combo box wouldn't cause problems with the load event would it?  My code for the combo box is shown below.  The javascript function is in a normal script block so that should be fine.

Regards,

Jon

                                <telerik:RadComboBox ID="uxTypeID" Runat="server"   
                                    OnClientDropDownOpened="OnTypeDropDownOpenedHandler"   
                                    EmptyMessage=" - Select a Type - " CssClass="fullWidthComboBoxSP"   
                                    AutoPostBack="True" OnClientLoad="clientLoad">  
                                    <ItemTemplate> 
                                        <div id="uxTypeDiv">  
                                            <telerik:RadTreeView ID="uxTypeRadTreeView" Runat="server"   
                                                DataFieldID="DocumentTypeID" DataFieldParentID="ParentDocumentTypeID"   
                                                DataSourceID="uxTypeSqlDataSource" DataTextField="DocumentType"   
                                                DataValueField="DocumentTypeID" Height="400"   
                                                OnClientNodeClicking="typeNodeClicking"   
                                                onnodedatabound="uxTypeRadTreeView_NodeDataBound" ShowLineImages="False"   
                                                Width="460px"></telerik:RadTreeView> 
                                        </div> 
                                    </ItemTemplate> 
                                    <Items> 
                                        <telerik:RadComboBoxItem Text="" /> 
                                    </Items> 
                                </telerik:RadComboBox> 
0
Kamen Bundev
Telerik team
answered on 11 Aug 2009, 04:18 PM
Hello Jon,

Just tested it with your markup and it worked. Can you send me a sample project or a live URL so I can check why is it not working for you? Open a support ticket to attach a file. Thank you in advance for your trouble.

Kind regards,
Kamen Bundev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 13 Aug 2009, 01:37 PM
Hi Kamen,

I've gotten back onto this again and found that it does work however because of the way teh control is working when I select an entry in the treeview the JS that runs to put the value from the treeview into the combo box somehow resets the entry to blue.

Re-reading your comment you said that the boxes will first appear normal and then become what I want - could you clarify what you meant as that maybe what I'm experiencing?

Regards,

Jon
0
Kamen Bundev
Telerik team
answered on 13 Aug 2009, 02:27 PM
Hello Jon,

I meant that OnClientLoad handler is called after the RadComboBox is initialized so it may take a while after the page loads before it runs. After that the read only RadComboBoxes should stay the same. Can you send me this javascript you're talking about (or a sample project), so I can see what is going on? Thank you for the trouble.

Greetings,
Kamen Bundev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 13 Aug 2009, 02:54 PM
Hi Kamen,

I see what you mean now.  I'll send you a copy of my page via a support ticket shortly.  I'll add in some commenting to try and explain what is going on in the page.  There is a secondary issue that I need to address with the treeview/combo box so will mention that in the cover message.

Best Regards,

Jon
Tags
ComboBox
Asked by
Jon
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Jon
Top achievements
Rank 1
Share this question
or