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

Incorrect Namespace for RadComboBox

4 Answers 145 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ajitha
Top achievements
Rank 1
ajitha asked on 19 May 2011, 10:51 PM

Hello There,
When I use the RadComboBox with multiple checkbox in it, I get the below exception

Unknown namespace http://schemas.telerik.com/2008/xaml/presentation

This code i picked up from Telerik forum.

<telerikInput:RadComboBox VerticalAlignment="Top" Width="200"

         ItemsSource="{Binding DataItems, Source={StaticResource DataViewModel}}" SelectedIndex="0">

 

          <telerikInput:RadComboBox.ItemTemplate>

                   <DataTemplate>

                           <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Content="{Binding Text}" />

                   </DataTemplate>

          </telerikInput:RadComboBox.ItemTemplate>

 

          <telerikInput:RadComboBox.SelectionBoxTemplate>

                  <DataTemplate>

                          <TextBlock

                                    Text="{Binding Owner.CheckedItems, Converter={StaticResource ValueConverter}}" />

                           </DataTemplate>

          </telerikInput:RadComboBox.SelectionBoxTemplate>

 

</telerikInput:RadComboBox>

Below is the version of telerik installed

Telerik Silverlight VSExtensions   2011.01.414.0

Telerik RadControls for Silverlight VSExtensions Package

I want a Combobox with checkboxes to select multiple values and display it in the combobox all the multiple values that were checked in the checlbox. I looked in the forums and found some cases but it didn't work for me. i was getting errors like the above one.
I am able to show the values with checkboxes but i am not able to display the selected values in the combobox when the combobox is collapsed.
When i use

 

 

cmbAcct.SelectedItem = Obj;
it displays only one item and that too with the checkbox.

Any help is appreciated.

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 20 May 2011, 12:42 PM
Hello Ajitha,

The fact that you are using CheckBoxes in your RadComboBox is actually not relevant to the namespaces used in your UserControl. Please, share the namespaces that the UserControl containing the RadComboBox uses.

For example, you should have something like this:
xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

We have a sample that fits your scenario. You can find it attached.

I hope this helps.

All the best,
Dani
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
0
ajitha
Top achievements
Rank 1
answered on 20 May 2011, 06:32 PM
Thanks for the QUick response,

These are the namespaces that the usercontrol is using.

xmlns

 

 

:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:t="http://schemas.microsoft.com/netfx/2007/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

 

 

 

xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006

Also i am using the DomainDataSource to display the data in the combobox

The code looks like this. This code displays the combobox with the checkboxes and the data. but i am not able to handle the display back in the combobox when the combobox is collapsed.

 

 

<telerik:RadComboBox HorizontalAlignment="Left" Margin="0,1,0,0"

 

Name="cmbALJorBM" VerticalAlignment="Top" Width="400" Height="24"

 

SelectedValuePath = "IDAljorBM"

 

ItemsSource="{ Binding Data, ElementName= ddsALJorBMList_EditRootDomainDataSource}"

 

SelectionChanged="cmbALJorBM_SelectionChanged"

 

SelectAllTextEvent ="None"

 

>

 

<telerik:RadComboBox.ItemTemplate >

 

<DataTemplate >

 

<StackPanel Orientation="Horizontal">

 

<CheckBox HorizontalAlignment="Left" Width="24" Height="24" IsChecked="{Binding IsChecked, Mode=TwoWay}" Click="CheckBox_Click" />

 

<TextBlock HorizontalAlignment="Left" Text="{Binding SignatureName}"

 

 

 

/>

 

 

 

 

 

 

</StackPanel>

 

</DataTemplate>

 

</telerik:RadComboBox.ItemTemplate>

 

</telerik:RadComboBox>


Any help is appreciated

 

Thanks
Ajitha

 

 

 

 

 

0
ajitha
Top achievements
Rank 1
answered on 20 May 2011, 08:57 PM
I forgot to add the complete code.

Thanks for the QUick response,

These are the namespaces that the usercontrol is using.

 

xmlns

 

:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

xmlns:t="http://schemas.microsoft.com/netfx/2007/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

xmlns:d=http://schemas.microsoft.com/expression/blend/2008

 

 

xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006

Also i am using the DomainDataSource to display the data in the combobox

The code looks like this. This code displays the combobox with the checkboxes and the data. but i am not able to handle the display back in the combobox when the combobox is collapsed.

 

 

 

 

 

 

 

 

 

<riaControls:DomainDataSource AutoLoad="False" d:DesignData="{d:DesignInstance busobj:ALJorBM_EditRoot, CreateList=True}"

 

 

 

 

 

 

 

 

 

 

 

Height="0" Width="0" LoadedData="ddsALJorBMList_EditRootDomainDataSource_LoadedData"

 

 

 

 

 

 

 

 

 

 

 

Name="ddsALJorBMList_EditRootDomainDataSource" QueryName="GetALJorBM" Margin="0,0,680,136">

 

 

 

 

 

 

 

 

 

 

 

 

<riaControls:DomainDataSource.DataContext >

 

 

 

 

 

 

 

 

 

 

 

 

<busobjService:APSSmartSchedulingDomainContext></busobjService:APSSmartSchedulingDomainContext>

 

 

 

 

 

 

 

 

 

 

 

 

</riaControls:DomainDataSource.DataContext>

 

 

 

 

 

 

 

 

 

 

 

 

</riaControls:DomainDataSource>

 

 

<telerik:RadComboBox HorizontalAlignment="Left" Margin="0,1,0,0"

 

 Name="cmbALJorBM" VerticalAlignment="Top" Width="400" Height="24"

 

 SelectedValuePath = "IDAljorBM"

 

 ItemsSource="{ Binding Data, ElementName= ddsALJorBMList_EditRootDomainDataSource}"

 

 SelectionChanged="cmbALJorBM_SelectionChanged"

 

 SelectAllTextEvent ="None"

 

 >

 

 

 

<telerik:RadComboBox.ItemTemplate >

 

 <DataTemplate >

 

 <StackPanel Orientation="Horizontal">

 

 <CheckBox HorizontalAlignment="Left" Width="24" Height="24" IsChecked="{Binding IsChecked, Mode=TwoWay}" Click="CheckBox_Click" />

 

 <TextBlock HorizontalAlignment="Left" Text="{Binding SignatureName}"

 

 />

</StackPanel>

 

 </DataTemplate>

 

 </telerik:RadComboBox.ItemTemplate>

 

 </telerik:RadComboBox>

Any help is appreciated

 

 

 

Thanks
Ajitha

 

 

0
Dani
Telerik team
answered on 26 May 2011, 08:50 AM
Hi Ajitha,

As far as I can see, you do not have the telerik namespace in your UserControl at all. Please, make sure you have added the following namespace:

Also, please consider again the attached sample I posted - it contains a SelectionBoxTemplate. You need the SelectionBoxTemplate to visualize the multi selected values in the combo.

You can also remove any unnecessary properties - like SelectAllTextEvent, for instance. The property is used with editable RadComboBoxes, and your RadComboBox is non-editable.

I hope this helps.


Regards,
Dani
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
ajitha
Top achievements
Rank 1
Answers by
Dani
Telerik team
ajitha
Top achievements
Rank 1
Share this question
or