Telerik Forums
UI for WPF Forum
0 answers
14 views

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. 

swapnil
Top achievements
Rank 1
 updated question on 19 Mar 2024
1 answer
18 views

See the following:

Dispatcher process has been suspended, but messages are still being processed. in UI for WPF | Telerik Forums

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.

 

Vladimir Stoyanov
Telerik team
 answered on 24 Jan 2024
1 answer
17 views
In the WPF Demos (RadAutoCompleteBox RadHighlightTextBox), the only code shown is a skeleton XAML and not the parts of the code that actually do the work. Where can I find that example's code? I searched the Telerik GitHub repos to no avail.
Stenly
Telerik team
 answered on 01 Jan 2024
1 answer
33 views

Hi,

Would it be possible to have an editable AutoCompleteBox TextBox Part to mimic the RadWatermarkTextBox with floating Label?

Stenly
Telerik team
 answered on 01 Mar 2023
1 answer
114 views
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

Martin Ivanov
Telerik team
 answered on 30 Jan 2023
1 answer
95 views

   <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".

Martin Ivanov
Telerik team
 answered on 16 Dec 2022
1 answer
59 views

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):

Vicky
Telerik team
 answered on 21 Jun 2022
1 answer
74 views
When I Input some word it works,However when press BackSpace the highlights disappeared
Stenly
Telerik team
 answered on 13 Jun 2022
0 answers
52 views
Hello. How I can styling WatermarkContent in RadAutoCompleteBox?
For example DateTimeWatermarkTemplateProperty in RadDateTimePicker is simple to set. 
Igor.Antohin
Top achievements
Rank 1
Iron
 updated question on 24 Mar 2022
1 answer
270 views

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.

Stenly
Telerik team
 answered on 18 Jan 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?