Telerik Forums
UI for WPF Forum
0 answers
1 view

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
19 views

Hello. 
I want to add Custom User control to RadDocument in RadRichTextBox. So I use InlineUiContainer to do that. And add it to paragraph.

And it looks so that I have to define height and width to make it so that it will take correct space in the document layout. If I skip this step then it looks like it takes zero width and height.
Looks strange. Because of course I don't know physical size of element in advance. As workaround I can do some "magic" with Loaded event and extract size of UiElement once it was rendered. And it works. But definitely it looks like a dirty code. 
I believe I miss something. Please help me. What am I doing wrong here? :)

By the way when I need to add InlineUiElement  to standard WPF RichTextBox it does all calculations of size by itself.

Dimitar
Telerik team
 answered on 28 Feb 2024
2 answers
24 views

As you can see in the picture the button just gets cut. It only does this if the hight is less than 38

<Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="70"/><RowDefinition Height="*"/></Grid.RowDefinitions><Grid Grid.Row="1" > <telerik:RadDropDownButton HorizontalAlignment="Right" Margin="0,0,20,10" Background="#EFEFEF" Padding="5,0,0,0" Height="24" BorderThickness="1" BorderBrush="LightGray" CornerRadius="5" telerik:StyleManager.Theme="Windows11" > <telerik:RadDropDownButton.Content>


Dimitar
Telerik team
 answered on 22 Jan 2024
0 answers
14 views

Hi,

Is there a way for a telerik radbutton to only show the image that's chosen for a button? 

Opacity is at 100% yet i am still seeing the actual button outline and grey fill/background around my buttons.

See below image.

Thanks

 

Yves
Top achievements
Rank 1
 asked on 04 Jan 2024
1 answer
17 views

I have a RadBusyIndicator and inside it I have several other controls; the structure is bit complex and there are several DB operations are performed in that and while performing that DB operations we are setting IsBusy property of RadBusyIndicator as per progress to true and false. But after invoking this property keyboard focus is shifted to the main window which is not the correct behavior. 

I want my focus on the current control from where I am calling some commands, and it is doing some DB operations.

I have gone through the below solution, but it is not much helpful in my case because the structure of my code is bit complex and I don't want BusyIndication invoked every five seconds as mentioned in this link - "how to restore the focus"

Any help regarding this is much appreciated.

Dimitar
Telerik team
 answered on 15 Dec 2023
0 answers
27 views
hello
I am Korean, so please understand that I wrote this in translation.

[inquiry]
As the title suggests, there is a problem with my source code and it cannot be resolved.

I am coding in MVVM method.

1. Enter TEXT in “ChangeDetails” [Cell] of [Grid View]
2. When executing the event of “PgmUpCommand”
3. “ChangeDetails” does not lose focus, and the bound “ChangeDetails” value cannot be retrieved.
4. After doing number 1, click another [Cell] in the [Grid] and execute number 2 to get the “ChangeDetails” value normally.

I would appreciate it if you could tell me the solution.

Below is the source

<telerik:RadGridView x:Name="dataGrid1" Grid.Column="1" IsReadOnly="False"
ItemsSource="{Binding PgmInfoList}"
SelectedItem="{Binding SelectedPgmInfoItem, Mode=TwoWay}" Margin="239,27,-0.2,-0.4" Grid.RowSpan="2" Grid.ColumnSpan="3" >
<i:Interaction.Behaviors>
<behaviors:GridViewBehavior UseSummaryInfo="False" ShowFooterInfo="False"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
   <prism:InvokeCommandAction Command="{Binding GroupDetailLoadedCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="CellEditEnded">
   <prism:InvokeCommandAction Command="{Binding CellEditEndedCommand}" />
</i:EventTrigger>
<i:EventTrigger EventName="SelectedCellsChanged">
   <prism:InvokeCommandAction Command="{Binding PgmInfoSelectedCellChangedCommand}"/>
</i:EventTrigger>
<i:EventTrigger EventName="RowEditEnded">
   <prism:InvokeCommandAction Command="{Binding RowEditEndedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<telerik:RadGridView.ColumnGroups>
<telerik:GridViewColumnGroup Name="Division" Header="" />
<telerik:GridViewColumnGroup Name="Regist" Header="{Binding [WRD_RegistChangeHistory], Source={StaticResource DRes}}" />
<telerik:GridViewColumnGroup Name="Upload" Header="{Binding [WRD_UploadPGMfile], Source={StaticResource DRes}}" />
</telerik:RadGridView.ColumnGroups>
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ChangeDetails, Mode=TwoWay}" IsReadOnlyBinding="{Binding Path=IsEnableReadOnly, Mode=TwoWay}"
                                    Header="{Binding [WRD_ChangeHistory1], Source={StaticResource DRes}}"
                                HeaderCellStyle="{StaticResource GridViewHeaderRowStyleBV}"
                                ColumnGroupName="Regist"/>
        <telerik:GridViewDataColumn Header="{Binding [WRD_UP], Source={StaticResource DRes}}" ColumnGroupName="Upload" HeaderCellStyle="{StaticResource GridViewHeaderRowStyleB}">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <Button
                                Command="{Binding DataContext.PgmUpCommand,  RelativeSource={RelativeSource Mode=FindAncestor, AncestorLevel=1, AncestorType={x:Type telerik:RadGridView}}}"
                                CommandParameter="{Binding}"
                                Content="..." IsEnabled="{Binding PgmUpisEnabled}"/>
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


son
Top achievements
Rank 1
 asked on 07 Nov 2023
0 answers
29 views
I use the Windows8Touch Theme and the StyleManager (so the binaries with XAML) to style my Telerik app.  I also follow the Telerik instrructions on how to apply the theme to standard Microsoft controls, like `System.Windows.Controls.Button`

    https://docs.telerik.com/devtools/wpf/styling-and-appearance/how-to/styling-apperance-themes-mscontrols

I use this technique to style the generic Button control and it works well.  Here is the relevant line in my default Button style

        <Setter Property="telerik:StyleManager.Theme" Value="Windows8Touch"/>


But now I have a case in which I want to give my button a transparent background but otherwise have it use the Telerik theming.  This seems like it would be easy:  Just set the `Background` property to `{x:Static Brushes.Transparent}` and it should work fine, right?

And that does look great.  Right up until I push the button.  When I push it, the background changes from transparent to... my default app background.  I want it to stay transparentd

Is there a simple property I can set or a style change I can make to achieve this.  I would prefer to avoid having to write a ControlTemplate for the button.

When I looked at the Telerik XAML, it appeared that I might be able to set a property like `mat:MaterialAssist.PressedBrush`

        <Setter Property="mat:MaterialAssist.PressedBrush" Value="Transparent"/>


or perhaps use `ThemeHelper.SetPressedBackgroundBrush` to achieve what I want


            `ThemeHelper.SetPressedBackgroundBrush(button, Brushes.Transparent);`


but neither of those two attempts made any difference.
Joe
Top achievements
Rank 2
Iron
Iron
Veteran
 asked on 27 Oct 2023
0 answers
22 views

Currently, I am working with RadNavigationView but I feel like I don't need dynamically bound DataContext because each settings tab would be different with various buttons. I tried RadTabControl but it isn't exactly what I'm going for style-wise. If anyone has any ideas please let me know.

Here is what I'm referencing.

Jake
Top achievements
Rank 1
 asked on 09 Oct 2023
0 answers
50 views
i have three xaml pages for my wpf panel. One is the main page which in the xaml has a <content x:Name=“page2”> defined and the page 2 is where my button is. This button has a mouse down event when pressed should show page 3. However i cant achieve that now with my implementation. How can i be able to do that? I am using xaml and code behind not mvvm
Yohannes
Top achievements
Rank 1
 asked on 14 Jul 2023
1 answer
46 views

Hello,

I just changed all project references from referencing the installed dll's (Progress\Telerik UI for WPF R1 2023\Binaries\WPF45) to nuget version (e.g. Telerik.Windows.Controls.GridView.for.Wpf.Xaml). Unfortunately, this results in some controls not redering at all any more.

I see this especially at <telerik:Label>, <telerik:Button> and <telerik:GroupBox> (using xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation")

If I instead use the standard WPF <Label> in the exact same XAML file, the label gets rendered.

Is there anything special one has to apply/change/update if changing from the "installed" version of Telerik for WPF to the nuget based version?

 

Any help or idea much appreciated,

Sebastian

Martin Ivanov
Telerik team
 answered on 15 Mar 2023
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?