AutoComplete and Locale Characters

12 posts, 0 answers
  1. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 29 Oct 2009 Link to this post

    Hi,

    I'm using AutoComplete on my ComboBox - works great. (Thx. Valeri)
    (I'm using ItemTemplate therefore also using TextSearch.TextPath to specify the property on my ItemsSource to filter on.)
    However it don't seem to work with danish characters like æøå ÆØÅ :-(

    update: If the Combobox IsEditable="true" it works with dk chars !

    I really need it to work with IsEditable="false" because I also have a SelectionBoxItemTemplate.

    /Lars

    Using RadControls for Silverlight 2009.3.1019.1030
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 29 Oct 2009 Link to this post

    Hi Lars,

    I am afraid that this time I will not be able to help. When RadComboBox is not editable (or is read-only) we cannot get the entered text from the TextBox and we rely on the KeyDown event to build a buffer with the typed keystrokes (because there is no TextInput event in Silverlight). Unfortunately, there is no reliable way to convert the PlatformKeyCode to its char representation for all cultures, hence the TextSearch does not work well with non english characters. Here is a forum thread about this problem:
    http://forums.silverlight.net/forums/p/14567/48122.aspx

    The scenario is not exactly the same, but we are affected by the same lack of functionality. Hopefuly in Silverlight 4 there will be a TextInput event and we will be able to fix this problem.

    Regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 29 Oct 2009 Link to this post

    Hi Valeri,

    Thanks for you fast answer !

    Yes I see the problem handling individual keys !!

    I tried this work around: On the event DropDownOpened - Set the IsEditable="true"
    And to get back to my SelectionBoxItemTemplate I set the IsEditable="False" on the event DropDownClosed.

    Sadly it gives me a nasty Unhandle error when setting IsEditable="true"

    (How ever I am able to set IsEditable="true" on the ComboBox from another control.)

    I could really use some help on this one !

    /Lars
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 29 Oct 2009 Link to this post

    Hi Lars,

    I would not recommend changing the IsEditable from DropDownOpened/Closed events, since it might cause unexpected results. Here is how you can do it, though:
    private void RadComboBox_DropDownOpened(object sender, EventArgs e)
    {
        Dispatcher.BeginInvoke(() => (sender as RadComboBox).IsEditable = true);
    }
    private void RadComboBox_DropDownClosed(object sender, EventArgs e)
    {
        Dispatcher.BeginInvoke(() => (sender as RadComboBox).IsEditable = false);
    }

    The problem is that when IsEditable is set, RadComboBox changes its control template, which disposes the dropdown Popup and the combo is automatically closed, because there is now a new Popup. The next click opens it, though.

    All the best,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 29 Oct 2009 Link to this post

    Hi Valeri,

    It worked but it was not pretty. So I dropped the idea.

    Autocomplete is not really useful without the danish characters - thinking about dropping it totally.

    One last thought - is it possible to somehow customize the module responsible for getting keyboard characters.
    Not a global solution but only to add 6 more characters to list.
    - Working with Silverlight/keyboard is new to me. But I will be willing to spend some more time on this one !

    Update:
    Key = Unknown
    PlaformKeyCode for "æ" = 192
    PlaformKeyCode for "ø" = 222
    PlaformKeyCode for "å" = 221


    Please point me in the right direction - or tell me if you believe it's impossible :-)

    /Lars
  7. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 30 Oct 2009 Link to this post

    Hi,

    I did some Investigating on the subject, I was shocked to learn that silverlight don't have support for non-US keyboards !!
    Lets hope for the best in SL4.
    Also I wonder why Telerik don't have the support already.
    See Link: http://michaelsync.net/2008/04/07/silverlight-2-beta1-international-non-us-textbox

    The easy solution (for me) for the above is a custom Combobox with a change in the private method RadComboBoxKeyDown

    to something like:
    char ch; 
    switch (e.PlatformKeyCode) 
       case 192: ch = 'Æ'; break
       case 222: ch = 'Ø'; break
       case 221: ch = 'Å'; break
       default: ch = Convert.ToChar(e.PlatformKeyCode); break
    this.AddTextInputString(ch); 
     

    /Lars



  8. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 02 Nov 2009 Link to this post

    Hi Lars,

    I guess the PlatformKeyCode-character map is the only option for the moment. I am afraid that I will not be able to implement this feature in RadComboBox for the Q3 release this week, but I will do my best to provide it for the internal build next week. I will post an example after it is ready.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 04 Nov 2009 Link to this post

    Hi Valeri,

    I just tested it for the release 2009.3.1103 and it works perfectly - also the resetting of the autocomplete buffer works.
    So I'm a happy man :-)

    Thanks and keep up the good work !

    /Lars

     
  10. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 08 Feb 2011 Link to this post

    Hi Valeri,

    Have been running fine on an old custom build for a while now.
     Now I have updated my app for SL4 running build 2010_3_1314

    Danish local characters still not working with the Combobox ?
    Does SL4 still have the problem with non-US keyboards ??

    Trying to build a new custom build but the private method RadComboBoxKeyDown have changed - can't find the way to implement my workaround...

    /Lars
  11. George
    Admin
    George avatar
    1332 posts

    Posted 11 Feb 2011 Link to this post

    Hi Lars,

     
    Could you please update with our latest Q3 SP1 binaries. Everything should be fine. 

    All the best,
    George
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  12. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 15 Feb 2011 Link to this post

    Hi George,

    Well 2010_3_1314 is the lastest Q3 SP1 right !?
    Remember I only have the problem when the Combobox.IsEditable=false;

    /Lars
  13. Lars Johansen
    Lars Johansen avatar
    31 posts
    Member since:
    Oct 2009

    Posted 15 Feb 2011 Link to this post

    Ups my mistake - it does work !!
    my binding telerik:TextSearch.TextPath="AutoComp" was filled with wrong data.

    /Lars 
Back to Top
DevCraft banner