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

AutoComplete and Locale Characters

11 Answers 153 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Lars Johansen
Top achievements
Rank 1
Lars Johansen asked on 29 Oct 2009, 10:56 AM
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

11 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 29 Oct 2009, 01:15 PM
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.
0
Lars Johansen
Top achievements
Rank 1
answered on 29 Oct 2009, 01:47 PM
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
0
Valeri Hristov
Telerik team
answered on 29 Oct 2009, 03:29 PM
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.
0
Lars Johansen
Top achievements
Rank 1
answered on 29 Oct 2009, 04:48 PM
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
0
Lars Johansen
Top achievements
Rank 1
answered on 30 Oct 2009, 10:17 AM
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



0
Valeri Hristov
Telerik team
answered on 02 Nov 2009, 07:52 AM
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.
0
Lars Johansen
Top achievements
Rank 1
answered on 04 Nov 2009, 03:19 PM
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

 
0
Lars Johansen
Top achievements
Rank 1
answered on 08 Feb 2011, 03:34 PM
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
0
George
Telerik team
answered on 11 Feb 2011, 03:43 PM
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>>
0
Lars Johansen
Top achievements
Rank 1
answered on 15 Feb 2011, 09:23 AM
Hi George,

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

/Lars
0
Lars Johansen
Top achievements
Rank 1
answered on 15 Feb 2011, 01:20 PM
Ups my mistake - it does work !!
my binding telerik:TextSearch.TextPath="AutoComp" was filled with wrong data.

/Lars 
Tags
ComboBox
Asked by
Lars Johansen
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Lars Johansen
Top achievements
Rank 1
George
Telerik team
Share this question
or