binding not working on computer (surface pro 2)

3 posts, 1 answers
  1. Robert
    Robert avatar
    57 posts
    Member since:
    Sep 2011

    Posted 22 May 2014 Link to this post

           we are using a telerik autocomplete box.  Now, the code pasted below works on ALL computers except my surface pro 2.  any reason you know of?

    Interestingly, this used to work on my machine because I approved the developers update.

    The problem is that even though the "SelectedServices" is being populated, the control on the UI is not getting it.  and the control on the UI is not sending down the data either.

    I can post any more info you guys need to help trace this.  But again, code works on all computers except surface pro 2 with windows 8.1

    ​ <telerik:RadAutoCompleteBox x:Name="ServicesAutoCompleteBox"
    FilteringBehavior="{StaticResource CustomFilteringBehavior}"
    ItemsSource="{Binding ServiceItems}"
    SelectedItems="{Binding SelectedServices,
    WatermarkContent="Type or click to add Services...."
    <DataTemplate DataType="lookups:ItemLookupViewModel">
    <WrapPanel Width="{Binding ElementName=ServicesAutoCompleteBox,
    Margin="0 0 -30 0"
    <TextBlock Padding="0 0 30 0"
    Text="{Binding ItemText}"

    #region Methods

    private void PopulatAutoBoxCollection(object sender)
    var autoComplete = (RadAutoCompleteBox) sender;


    #region Event Handlers

    private void UIElement_OnGotFocus(object sender, RoutedEventArgs e)


    public class CustomFilteringBehavior : FilteringBehavior
    #region Methods

    public override IEnumerable<object> FindMatchingItems(string searchText, System.Collections.IList items, IEnumerable<object> escapedItems, string textSearchPath, TextSearchMode textSearchMode)
    if (string.IsNullOrEmpty(searchText))
    return items.OfType<object>().Where(x => !escapedItems.Contains(x));
    return base.FindMatchingItems(searchText, items, escapedItems, textSearchPath, textSearchMode);


    public ObservableCollection<ItemLookupViewModel> ServiceItems { get; private set; }

    public ObservableCollection<ItemLookupViewModel> SelectedServices { get; set; }

    SelectedServices = new ObservableCollection<ItemLookupViewModel>();
    SelectedServices.CollectionChanged += SelectedServicesCollectionChanged;

    // Set Services.-- this copies data from the model into the bound control

                foreach (var serviceItem in _solicitation.Services)
    foreach (var serviceItemVm in ServiceItems)
    if (serviceItem.Service.RefItemId == serviceItemVm.ItemId)

    private void SelectedServicesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)

    if (e.NewItems != null && e.NewItems.Count != 0)
    // foreach (ItemLookupViewModel siVm in e.NewItems)
    // {
    // }

    if (e.OldItems != null && e.OldItems.Count != 0)
    foreach (ItemLookupViewModel siVm in e.OldItems)

  2. Answer
    Georgi avatar
    364 posts

    Posted 23 May 2014 Link to this post

    Hi Robert,

    This is really strange and at the same time interesting issue and we would like to get to the bottom of it. So first we need to make sure that we have the right project in which the issue can be reproduced. Therefore I have created a project where I have tried to get as close as i can to your scenario and it would be great if you can check it out and let us know if the issue can be reproduce in it.

    Please note, that right now we cannot get our hands on Surface pro 2 in order to test the issue, but I hope soon we will be able to.

    Meanwhile it would be great if you can let us know what versions of the Operating System and .Net are installed on the tested machines as well as if they have any touch monitor (like the Surface pro 2).

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. Robert
    Robert avatar
    57 posts
    Member since:
    Sep 2011

    Posted 16 Jun 2014 in reply to Georgi Link to this post

    interestingly, I upgrade the wpf controls to recent version and uninstalled older versions.  (regular windows update in the iterim), and lo and behold, the controls began working again.

    i don't plan on doing any more investigation or analysis at this point. 

    thanks for the help!
Back to Top