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

RadCombo Text Search is not working

5 Answers 298 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vinotha
Top achievements
Rank 1
vinotha asked on 27 Oct 2010, 02:48 PM
I have binded RadCombo in RadGridView.And i have added IsEditable="True" TextSearchMode="Contains" IsTextSearchEnabled="True" property to the RadCombobox ,however text search is not working.Kindly provide me the solution for this problem.I have copied the piece of code which has the RadComboBox.Kindly review it and let me know the solution.

<

 

 

telerik:GridViewDataColumn DataMemberBinding="{Binding PromptID}" Header="Prompts" Width="*" > <telerik:GridViewDataColumn.CellTemplate 

 

<DataTemplate> <input:RadComboBox x:Name="comboPrompts" IsEditable="True" TextSearchMode="Contains" IsTextSearchEnabled="True" EmptyText="Select"  

 

 

DisplayMemberPath="CodeAndText"

 

SelectedValuePath="PromptID"

 

SelectedValue="{Binding PromptID}"

 

ItemsSource="{Binding Path=PromptsForStep, Source={StaticResource PromptsSource},Mode=TwoWay}"/>

 

</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate 

 

<telerik:GridViewDataColumn.CellEditTemplate
<DataTemplate>
<input:RadComboBox x:Name="comboPrompts" TextSearchMode="Contains" IsTextSearchEnabled="True" EmptyText="Select" IsEditable="True"

 

DisplayMemberPath="CodeAndText" SelectedValuePath="PromptID"

 

SelectedValue="{Binding PromptID}"

 

ItemsSource="{Binding Path=PromptsForStep, Source={StaticResource PromptsSource},Mode=TwoWay}"/>

 

 

</DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate>

 

 

 

</telerik:GridViewDataColumn>

Thanks
Vinotha

 

 

 

 

 

5 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 29 Oct 2010, 11:34 AM
Hello vinotha,

Your XAML seems OK . Things should be working with this setup . Can you please paste me the c# implementation of the objects you use to feed RadGridView and the combo box with data..
This will be in help to reproduce the issue and find the cause.

Regards,
Pavel Pavlov
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
vinotha
Top achievements
Rank 1
answered on 01 Nov 2010, 12:02 PM
Hi,

  Thank you for your reply.I have attached the c# class which i have been using to bind RadComboBox.

using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace IVRSDesigner
{
    public class PromptsComboSource
    {
        public static ObservableCollection<DataReference.Prompts> PromptsForStep
        {
            get
            {
                return _promptsForStep;
            }
            set
            {
                _promptsForStep = value;

            }
        }
        private static ObservableCollection<DataReference.Prompts> _promptsForStep = new ObservableCollection<DataReference.Prompts>();

    }
}

I am using the following service method to bind the RadComboBox ,i am calling the service method in class constructor.

 

 

void ServiceRef_GetAllPromptsCodeTextCompleted(object sender, DataReference.GetAllPromptsCodeTextCompletedEventArgs e)

 

{

 

 

try

 

{

 

 

PromptsComboSource.PromptsForStep = e.Result;

 

}

 

 

catch (Exception ex)

 

{

 

 

MessageBox.Show(ExceptionResources.ExceptionLoadingPromptCodeText + ErrorResources.RefreshMessage);

 

 

 

ExceptionLogger.LogException(ex);

 

}

}

0
Accepted
Pavel Pavlov
Telerik team
answered on 04 Nov 2010, 02:29 PM
Hi vinotha,

I was talking about the business objects ( e.g. the DataReference.Prompts) so I could build a repro project here.

Nevermind,
I think I have figured out the issue :
Please try the following settings for the combobox :
                             IsTextSearchEnabled="True"
                             TextSearchMode="Contains" 
                             IsDropDownOpen="True"
                             IsEditable="True"


Please note that in TextSearchMode contains , RadComboBox will not autocomplete the text, it would only highlight the item found in the dropdown .

Best wishes,
Pavel Pavlov
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
vinotha
Top achievements
Rank 1
answered on 09 Nov 2010, 03:02 PM
Hi,
  Yes, you have given the solution. Thanks for your help.Now it is working good.

Thanks
vinotha
0
Don
Top achievements
Rank 1
answered on 18 Jun 2020, 03:53 PM

I have implemented Custom Filtering solution, (Filtering on multiple Paths - ID + DESC)
the issue I run into is the selected item does not get set properly with case insensitive 

I created a custom control inheriting from RadComboBox and then I have set these values in the constructor:

public RadComboBoxCustomFilter()
        {

           //  this should allow for case insensitive (type joe and I should be able to select JOE) 
           // ** JOE is NOT SELECTED because it did not match "joe" exactly - will automatically select the FIRST filtered item in list.
           // ** JOEL - IS Selected if Clicked or Press Enter over item

            TextSearchMode = TextSearchMode.Contains; // case insensitive setting
            IsTextSearchEnabled = true;
            IsEditable = true; // allow text to be entered into the textbox to seach
            OpenDropDownOnFocus = true;
            StaysOpenOnEdit = true;
            IsFilteringEnabled = true; // makes the filtering possible
            UpdateTextOnLostFocus = true;
            TextSearch.SetTextPath(this, "ID"); //after item is selected this is the display. If not set it does not know how to display because I use a custom Item Template { ID + DESC }
            FilteringBehavior = new RadComboBoxCustomFilterBehavior();
        }

 

Please let me know if you need additional information to reproduce this issue.

Tags
General Discussions
Asked by
vinotha
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
vinotha
Top achievements
Rank 1
Don
Top achievements
Rank 1
Share this question
or