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

.checked = true not working

3 Answers 102 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 30 Nov 2015, 07:46 AM

 HI Community

 

I have a radcombobox with checkboxes. i like check all items bases on an ; delemited string. 

i'm looping an array and if i find the value i set the checked option to true. 

when i debug the code im getting to the part where i the checked = true ..... but when i open the box the value is not checked

 

any suggestions why it happens ? 

thanks 

Dennis 

 

                foreach (string Fund in aFunds)
                {


                    if (cbFunds.FindItemIndexByText(Fund) != -1)
                    {

                        cbFunds.FindItemByText(Fund).Checked = true;

                    }


                }

3 Answers, 1 is accepted

Sort by
0
Dennis
Top achievements
Rank 1
answered on 30 Nov 2015, 07:48 AM
i'm using version 2015.3.930.40 
0
Dennis
Top achievements
Rank 1
answered on 30 Nov 2015, 10:46 AM
it is solved ..... it was not working with the OnTextChanged Event ..... i added a button which starts the process to parse the textbox and check all found items in the combobox
0
Eyup
Telerik team
answered on 03 Dec 2015, 06:44 AM
Hi Dennis,

You can further optimize your code by applying the following modification:
RadComboBoxItem item = RadComboBox1.FindItemByText("Success");
if (item != null)
{
    item.Text = "dsad";
}

Hope this helps.

Regards,
Eyup
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
Tags
ComboBox
Asked by
Dennis
Top achievements
Rank 1
Answers by
Dennis
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or