Hi
Please find my below code showing the celledittemplate
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<tbcontrols:SmartSearchRadAutoCompleteBox x:Name="JournalSuggestions" AutomationProperties.AutomationId="JournalSuggestions"
Style="{StaticResource SmartControlStyle}"
SelectionMode="Single"
KeyDown="JournalSuggestions_KeyDown"
PreviewGotKeyboardFocus="JournalSuggestions_PreviewGotKeyboardFocus"
Populating="JournalSuggestions_Populating"
Width="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewDataColumn}, Path=ActualWidth}"
BorderThickness="0"
BorderBrush="Transparent"
ClipToBounds="True"
AutoCompleteMode="Suggest"
ItemsSource="{Binding Source={StaticResource SmartJournalAccounts}}"
DisplayMemberPath="Code"
FilteringBehavior="{StaticResource LocalJournalFilter}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
DropDownItemTemplate="{Binding Source={StaticResource CustomDropDownTemplate}}"
NoResultsContentTemplate="{StaticResource NoResultsContentTemplate}"
DropDownWidth="Auto"
BoxesItemStyle="{StaticResource CustomRadAutoCompleteBoxesItemStyle}"
IsEnabled="True"
Margin="-17 0 0 0"
SearchText="{Binding DataContext.SmartControlSearchText, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadGridView}}, UpdateSourceTrigger=PropertyChanged, Mode=OneWayToSource}"
SelectedItem="{Binding Path=SmartJournalAccountItem, Mode=TwoWay}"
TextSearchMode="Contains" TextBoxStyle="{StaticResource TrailBalanceAccountTextBoxStyle}" FontSize="12" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cal:ActionMessage MethodName="AutoCompleteBoxSelectionChanged">
<cal:Parameter Value="{Binding SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadAutoCompleteBox}}}"></cal:Parameter>
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<i:Interaction.Behaviors>
<behaviours:RadAutoCompleteBoxBehavior/>
</i:Interaction.Behaviors>
</tbcontrols:SmartSearchRadAutoCompleteBox>
<Button x:Name="SearchButton" Grid.Column="1"
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=controls:APTPanel}}"
Click="SearchButton_Click">
<Button.Visibility>
<con:ConverterBindableBinding Binding="{Binding IsSearchAccountVisible,UpdateSourceTrigger=PropertyChanged}"
Converter="{StaticResource BooleanToVisibilityConverter}"
ConverterParameterBinding="{Binding IsSearchAccountVisible, RelativeSource={RelativeSource AncestorType={x:Type controls:APTPanel}}, UpdateSourceTrigger=PropertyChanged}">
</con:ConverterBindableBinding>
</Button.Visibility>
</Button>
</Grid>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
If I click the "SearchButton" on first click the event does not fire, the click event fires if I click it second time.
If I remove the SmartSearchRadAutoCompleteBox control & only keep the SearchButton then it works ok.
Can someone give me code snippet having multiple controls (one radautosearchbox & one button) in datatemplate of celledittemplate or help me understand what is causing issue in my Click event
Regards,
Swapnil.
See the following:
I cannot reproduce using a simple test project. I am attaching a Word VSTO project that is a test version. I have removed packages which included Fody PropertyChanged and the Telerik Xaml controls.
We are seeing a Dispatch Processor error in Word when the HighlightText is enabled. It goes away if that is removed. Our VSTO project is way too large to easily demo but we passed QA if that HighlightText is removed. Why that is happening is hard to say since Word COM provides little to no information on the issue.
I will compare code against Vladimir's sample and see if I can spot differences. Will get back if something pops out.
Hi,
Would it be possible to have an editable AutoCompleteBox TextBox Part to mimic the RadWatermarkTextBox with floating Label?
I have the following class
Class My Class
Class MyClass()
{
public int Var1 {get; set; }
public int Var2 {get; set; }
}
i want the selected item to show {var1}/{var2}
for now im doing (for now) is
DisplayMemberPath = "Var1"
but because its a String and a Dependency property i cannot attach a MultiBinding
and RadMultiColumnComboBox does not have itemTemplate property
how can i achieve it
P.S
I want the same behavior for the tooltip
p.s 2
i also want to center the selected text but it seems HorizontalContentAlignment is not working
Thanks in advance
<telerik:RadAutoCompleteBox TextSearchMode="Contains" SelectedItem="{Binding Entity, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="Name" HorizontalAlignment="Stretch" SelectionMode="Single" Margin="125,100,0,10" VerticalAlignment="Top" Width="Auto" Grid.Column="0" Name="customerACB" SearchTextChanged="customerACB_SearchTextChanged" AutoCompleteMode="Suggest" >
<telerik:RadAutoCompleteBox.DropDownItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Label Content="{Binding Code}" Width="70" />
<Label Content="{Binding Name}" Width="310" />
</StackPanel>
</DataTemplate>
</telerik:RadAutoCompleteBox.DropDownItemTemplate>
</telerik:RadAutoCompleteBox>
Currently, i am able to search using "Name". If I change displaymemberpath to code it will show the result if the search string match with "code"
I need to search using both values "Name" and "code".
I'm looking to convert all my style in my application to Windows11 style.
However, I have a little probleme with TextBox. As we create a control template for our textbox to add a button, I'm not able to replicate the Windows11 style in my template.
Our textbox looks like this:
Button can be shown or not.
Now, I want a look like this (this is the autocompletebox):
I've noticed in the Auto Complete Box if you type a selection (or paste) and then left mouse click off the control the Selected Item will not be populated.
If I type (or paste) a selection and hit the "tab" key it will select the item.
How can I select the item when the user left mouse clicks off the control?
I can easily duplicate this with the "Auto Complete Box | First Look" from the WPF Controls Example.
See the attached pics.
The first example I typed "Respect" into the autocomplete box for Best Music Hit. I hit the Tab button and the data populated.
The second example I typed "Respect" into the autocomplete box for Best Music Hit. I then left mouse clicked outside of that control and the data does not populate.
Please advise.