Hello,
I am trying to use a RadComboBox with all these properties set:
My intent is to have an auto-completable (using the "Name" property of my data object) combobox that has one template for the selected item, and another template for the listed items. Unfortunately, when I set the "telerik:TextSearch.TextPath" and "IsEditable" properties, it seems to ignore the SelectedBoxTemplate property...
Thoughts on how I might accomplish this or if the properties will be able to co-exist in the future?
Thanks.
I am trying to use a RadComboBox with all these properties set:
<telerik:RadComboBox |
ItemsSource="{Binding TheList, Source={StaticResource DataSource}}" |
SelectionBoxTemplate="{StaticResource dt_SelectionBoxTemplate}" |
ItemTemplate="{StaticResource dt_ItemTemplate}" |
telerik:TextSearch.TextPath="Name" |
IsEditable="True" |
IsReadOnly="True" |
/> |
My intent is to have an auto-completable (using the "Name" property of my data object) combobox that has one template for the selected item, and another template for the listed items. Unfortunately, when I set the "telerik:TextSearch.TextPath" and "IsEditable" properties, it seems to ignore the SelectedBoxTemplate property...
Thoughts on how I might accomplish this or if the properties will be able to co-exist in the future?
Thanks.
12 Answers, 1 is accepted
0
Hello Rob,
You are correct - when IsEditable = true, the SelectionBoxTemplate is ignored because the control displays a TextBox at the same place.
Regards,
Valeri Hristov
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.
You are correct - when IsEditable = true, the SelectionBoxTemplate is ignored because the control displays a TextBox at the same place.
Regards,
Valeri Hristov
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
Dan Andrews
Top achievements
Rank 2
answered on 18 Jan 2011, 10:08 PM
Since the template is ignored, how can we style the textbox that replaces it. For instance, I'd like to set the HorizontalContentAlignment to Left.
0
Dan Andrews
Top achievements
Rank 2
answered on 18 Jan 2011, 10:40 PM
Just for clarification:
But if the "Name" is wider than the RadComboBox, then it alligns the text to the right.
<
t:RadComboBox
Name
=
"KAGSubsidiaryComboBox"
Margin
=
"0,1"
t:TextSearch.TextPath
=
"Name"
SelectedValuePath
=
"Code"
SelectedValue
=
"{Binding Path=Entity, Mode=TwoWay, NotifyOnValidationError=True}"
IsEditable
=
"True"
Grid.Column
=
"1"
Grid.Row
=
"4"
TabIndex
=
"7"
Height
=
"24"
>
<
t:RadComboBox.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
FontWeight
=
"Bold"
Text
=
"{Binding Path=Code}"
/>
<
TextBlock
Text
=
": "
/>
<
TextBlock
Text
=
"{Binding Path=Name}"
/>
</
StackPanel
>
</
DataTemplate
>
</
t:RadComboBox.ItemTemplate
>
</
t:RadComboBox
>
But if the "Name" is wider than the RadComboBox, then it alligns the text to the right.
0
Hi Rob,
I am sorry for the delayed reply.
Note that the template has nothing to do with our RadComboBox:
This should keep the text left aligned if there is enough space and right aligned if the text starts to clip. I would recommend you also to put Transparent background and a tooltip on the outer border so the users can read the whole thing when it is clipped.
Best wishes,
Pana
the Telerik team
I am sorry for the delayed reply.
Note that the template has nothing to do with our RadComboBox:
<
Border
HorizontalAlignment
=
"Left"
>
<
StackPanel
HorizontalAlignment
=
"Right"
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"asda asd fasdf asd sdasd"
/>
<
TextBlock
Text
=
": "
/>
<
TextBlock
Text
=
"asda sasdf asd fas fasfd dasd !!!"
/>
</
StackPanel
>
</
Border
>
This should keep the text left aligned if there is enough space and right aligned if the text starts to clip. I would recommend you also to put Transparent background and a tooltip on the outer border so the users can read the whole thing when it is clipped.
Best wishes,
Pana
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
Dan Andrews
Top achievements
Rank 2
answered on 25 Jan 2011, 02:19 PM
0
Hello Dan,
George
the Telerik team
Please, refer to the following link in our online documentation - http://www.telerik.com/help/silverlight/radcombobox-how-to-align-to-the-left-the-text-of-the-comboboxitem-when-it-is-too-long2.html
I hope this suits your needs.
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
Dan Andrews
Top achievements
Rank 2
answered on 31 Jan 2011, 02:53 PM
I've read that before, but what is concerning is: "To make it left aligned and remove the selection you can set the SelectAllTextEvent property of the ComboBox to None"
I don't want to remove the selection, my selected item should remain. I'll try it.
--------------------------------------------
Yep, it worked... this method is less than intutive.
I don't want to remove the selection, my selected item should remain. I'll try it.
--------------------------------------------
Yep, it worked... this method is less than intutive.
0
Dave Swersky
Top achievements
Rank 1
answered on 05 Feb 2011, 09:24 PM
Does this mean it's not possible to style the displayed/selected element in an editable combobox? I have a form where this would be ideal, I really need to be able to display a selected value AND allow the user to type-search for a new value.
0
Dave Swersky
Top achievements
Rank 1
answered on 05 Feb 2011, 10:03 PM
A hack- override ToString() on the objects you're populating
0
Mike
Top achievements
Rank 2
answered on 07 Jul 2011, 03:57 PM
Hi!
I need this behaviour as well, is there a chance to implement it in a future release?
greetings
Michael
I need this behaviour as well, is there a chance to implement it in a future release?
greetings
Michael
0
Dan Andrews
Top achievements
Rank 2
answered on 07 Jul 2011, 08:31 PM
Please see my last post. It works, but it's not obvious.
0
Hello,
OK, I hope Dan Andrews post would help. Meanwhile I have created a PITS item for the SelectionBox template in IsEditable = True mode.
Kind regards,
Pana
the Telerik team
OK, I hope Dan Andrews post would help. Meanwhile I have created a PITS item for the SelectionBox template in IsEditable = True mode.
Kind regards,
Pana
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>