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

SelectionBoxTemplate applying issue

4 Answers 135 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 06 Oct 2016, 10:18 AM

Hi 

   I want ComboBoxes with CheckBoxes. I have use the code in this Post. I am able to get the combobox Items with Checkboxes.But If I Check multiple Items,it is not reflecting in the ComboBox. I  think  I am doing wrong binding in the SelectionDataBoxTemplate.Could you please help me to resolve this.

<DataTemplate x:Key="SelectionBoxTemplate">
          <TextBlock Text="{Binding UserCtrlSelectedValue, RelativeSource={RelativeSource AncestorType=local:ComboBoxEditor}}"   Loaded="ControlCombo_Loaded"/>
      </DataTemplate>
 
<Grid>
      <telerik:RadComboBox  Name="ControlCombo" ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource AncestorType=local:ComboBoxEditor}}"  ItemTemplateSelector="{StaticResource dataTemplateSelector}" SelectionBoxTemplate="{StaticResource SelectionBoxTemplate}" />      
  </Grid>

The code above shown is for datatemplate and RadCombobox in UserControl. In DataTemplate I am binding the Text Property of textblock with one of the dependencyProperty on the usercontrol and the datacontext of combobox is not the usercontrol another viewmodel. 

I have tried the code in this post also.

Regards,

Nagasree.

 

4 Answers, 1 is accepted

Sort by
0
Dharmavaram
Top achievements
Rank 1
answered on 10 Oct 2016, 03:10 AM

Hi ,

   I have blocked on this issue and have been searching why it is not working for past 4 days.Any help on how to resolve this issue is greatly helpful for us.

Regards,

Nagasree

0
Stefan Nenchev
Telerik team
answered on 10 Oct 2016, 12:41 PM
Hi Nagasree,

In R3 2016, we have officially introduced the Multiple Selection feature of the RadComboBox. You can find more information on the following link from our documentation page - RadComboBox Multiple Selection. I suggest you try using the built-in implementation we have provided. Please update me whether it has worked for you.

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dharmavaram
Top achievements
Rank 1
answered on 12 Oct 2016, 05:37 AM

Hi Stefan,

  I have tried that but if we bind the property on my class to SelectedValue  on combobox it is giving only recently selected value. The complete string is available on Text Property of combobox but when Iam trying to bind and compile it is giving exception "Object reference not set to an instance"(Null reference Exception). 

I need to get the Complete text into one of the string property on my class.How to achieve it.I tried one way binding still it is giving exception.It is non editable combobox.

 

Regards,

Nagasree.

0
Stefan Nenchev
Telerik team
answered on 14 Oct 2016, 02:38 PM
Hi Nagasree,

The behavior you are looking for is not that straightforward to achieve. Generally, we have introduced the CollectionEditor as a default editor for collection properties in the RadPropertytGrid and we advise on using it. However, I have managed to come up with some custom solution for you. I have tested it in a simple scenario, so I cannot be sure it will achieve your requirement thoroughly enough, however, you can have a look at the approach and further modify it to your needs.

I hope it helps. 

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PropertyGrid
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Dharmavaram
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or