The data on my comboboxeditor is so long but i want to be able to display the beginning part of it after the user selects.
Please help
<ig:XamComboEditor x:Name="txtPreparerList" Grid.Column="3" Height="22" Margin="0,2,0,5" Width="180" Grid.Row="2" SelectedIndex="{Binding SelectedIndexForPreparerList,Mode=TwoWay}" CheckBoxVisibility="Visible" ItemsSource="{Binding PreparerList, Mode=TwoWay}" DisplayMemberPath="FirstName" SelectionChanged="txtPreparerList_SelectionChanged" AllowMultipleSelection="True" TabIndex="7" ></ig:XamComboEditor>
Hi,
There is no out-of-the-box way to do that. However, you can do that by deriving from XamComboEditor and setting the position of the caret yourself:
public class CustomXamComboEdiotor : XamComboEditor { private TextBox _textBoxPresenter; public override void OnApplyTemplate() { base.OnApplyTemplate(); this._textBoxPresenter = this.GetTemplateChild("TextBoxPresenter") as TextBox; } protected override void OnSelectionChanged() { base.OnSelectionChanged(); if (this._textBoxPresenter != null) { this.Dispatcher.BeginInvoke(new Action(() => { this._textBoxPresenter.SelectionStart = 0; this._textBoxPresenter.SelectionLength = 0; })); } } }
HTH
HI,
Please let me know if you need further assistance regarding this issue.
Sincerely, Matt
Developer Support Engineer
Thanks! This worked great.