RadCombobox Editing the Value

2 posts, 0 answers
  1. victor
    victor avatar
    5 posts
    Member since:
    Jun 2015

    Posted 17 Aug 2015 Link to this post

    Hi ,

    Here is Problem with RadCombobox Editing the Binding Value .

    Scenario:-I had bind the Collection to a RadCombobox which is  inside the grid with DataTemplate (code snap Provided With attachment), I selected the Value from Dropdown and went to next Column , next Come back to the same I want to edit that selected value instead of Selecting from dropdown ex:- I choose 8.50 from dropdown and  want to edit this value to 85.50 ,I focused the cursor inside the combobox between 8 and dot and try to enter the value 5 in between,that time the entire value is lost and  overwrites number 5 and  stays in box and I give the Property IsEditable = true also , how to achieve this Editing ? Can any one help on this

     

    Thanks

    Victor

     

     

  2. Georgi
    Admin
    Georgi avatar
    350 posts

    Posted 20 Aug 2015 Link to this post

    Hi Victor,

    By default when the user types in the editable RadComboBox searching and auto-completing to item from the ItemsSource is performed. Therefore when the 85.50 is entered it searches for item with DiscountPrice euqals to 85.50 and when such item is not found the selection is cleared.

    So if you want to edit the value of the DiscountPrice for the selected item you need first to disable the search functionality by setting the "IsTextSearchEnabled" property to false. This however will not update the DiscountPrice  value of the selected item and in order to achieve this behavior you need to synchronize it with the Text of the ComboBox:

        1. By direct binding:

    Text="{Binding SelectedItem.DiscountPrice, Mode=TwoWay, ElementName=combo}"


        2. By binding to the view model property holding the selected item:

    Text="{Binding PriceLevelTemplateCollection.DiscountPrice, Mode=TwoWay}"


    It would be great if you can give it a try and let us know if this works for you.
    Also if you have any other questions, please don't hesitate to write us.


    Regards,
    Georgi
    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
  3. DevCraft banner
Back to Top