I undestend that you some how with internal buisness logic set TextSearch.TextPath if developer set DisplayMemberPath value with ItemTemplate.
How you do it that with runtime code example?
I inherited your RadCombobox class
class EditComboBox : RadCombobox {
}
<Grid>
<controls:EditComboBox x:Name="ecbControl" telerik:TextSearch.TextPath="Description" />
</Grid>
How to dinamicly set
MyEditComboBox.TextSearch.TextPath="Description" ?
Here is my property
Place your code is settary of dependancy property.
How you do it that with runtime code example?
I inherited your RadCombobox class
class EditComboBox : RadCombobox {
}
<Grid>
<controls:EditComboBox x:Name="ecbControl" telerik:TextSearch.TextPath="Description" />
</Grid>
How to dinamicly set
MyEditComboBox.TextSearch.TextPath="Description" ?
Here is my property
private static readonly DependencyProperty CurrentDisplayMemberPathProperty = DependencyProperty.RegisterAttached("CurrentDisplayMemberPath", typeof(string), typeof(EditComboBoxUserControl), new FrameworkPropertyMetadata(OnCurrentDisplayMemberPath));
private static void OnCurrentDisplayMemberPath(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var view = (d as EditComboBoxUserControl);
if (view == null)
return;
string value = (string)e.NewValue;
view.CurrentDisplayMemberPath = value;
}
[DefaultValue("")]
[Localizability(LocalizationCategory.Text)]
[Bindable(true)]
public string CurrentDisplayMemberPath
{
get
{
return (string)GetValue(CurrentDisplayMemberPathProperty);
}
set
{
SetValue(CurrentDisplayMemberPathProperty, value);
// Telerik.Windows.Controls.TextSearch.SetTextPath(this.ecbControl, value);
//this.ecbControl.DisplayMemberPath = value;
}
}
Place your code is settary of dependancy property.