SelectionBoxTemplate applying issue

5 posts, 0 answers
  1. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 06 Oct Link to this post

    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.

     

  2. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 09 Oct Link to this post

    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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 10 Oct Link to this post

    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.
  5. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 12 Oct Link to this post

    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.

  6. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 14 Oct Link to this post

    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.
Back to Top
UI for WPF is Visual Studio 2017 Ready