Databind to the (typed) Text of AutoCompleteBox

2 posts, 0 answers
  1. Gyula
    Gyula avatar
    9 posts
    Member since:
    May 2012

    Posted 16 Nov 2012 Link to this post


    I'm trying to mimic the autocomplete behavior of Excel in a GridView. For this, I have DataBoundColumns, and replaced the CellEditTemplate with an AutoCompleteBox (ACB).
    <telerik:GridViewDataColumn DataMemberBinding="{Binding ItemContent}">
                    ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=telerik:RadGridView, AncestorLevel=1}, Path=DataContext.ListOfItemContent}"

    The not-so-simple ACB ItemsSource binding is for an MVVM approach, trying to reach the VM for the GridView.
    My questions:
    • Is there an easier way to do this? (for example, the ComboBoxColumn has ItemsSource and ItemsSourceBinding)
    • What is the "Text" property for an ACB? (Can't find one, and the on-line documentation is a bit scarce for this control...)
    • Could you make a new GridColumn type, that would use /inherit from/ ACB? (like the special ones you already have)

    According to this thread, the Text property would be the SearchText property, and it has some issues:
    I can reproduce the same exception with the above code. The ListOfItemContent is the list of strings in the current column. It's in the VM.

    public IEnumerable<string> ListOfItemContent
          (from i in this.MyBusinessObjects
          select i.ItemContent).Distinct();

    Thank you,

  2. Ivo
    Ivo avatar
    390 posts

    Posted 22 Nov 2012 Link to this post

    Hi Gyula,

    I would suggest you to use the SearchText property of the RadAutoCompleteBox. As you mentioned it had an issue into the Q3 2012 official release. However this issue is fixed into the latest internal build. The next official release that will include this fix is the Q3 SP1 and it will be released into the upcoming weeks.

    We will consider adding such a column into the RadGridView for one of the future versions of the control. In the meantime you can create a custom column type. More about this you can read into our online help and blogs.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top