Telerik Forums
UI for WPF Forum
1 answer
184 views

Hi team,

Let's say I have a set of shapes selected, a unique bounding box including all selected shapes is rendered.
is it possible to hide the bounding box? Or is it possible to customize the highligh of the single selected shapes?

I attached a sample picture (taken from powerpoint)

Thanks in advance

Dinko | Tech Support Engineer
Telerik team
 answered on 16 Jul 2019
3 answers
87 views

Hi Progress Team,

I added a RadCalendar component to my project but when changing the base week of this 2x2 grid calendar the weeknumbers stay the same all the time. Have I missed something here? How do they update? I used the following code for the XAML definition:

<telerik:RadCalendar
    Grid.Column="0"
    Margin="36,10,10,10"
    AreWeekNamesVisible="True"
    AreWeekNumbersVisible="True"
    CalendarWeekRule="FirstFourDayWeek"
    Columns="2"
    Culture="de-DE"
    DateSelectionMode="Day"
    FirstDayOfWeek="Monday"
    Foreground="White"
    Rows="2"
    SelectionMode="Extended"
    ViewsHeaderVisibility="Visible">
</telerik:RadCalendar>
Martin Ivanov
Telerik team
 answered on 16 Jul 2019
1 answer
220 views

Hello!

We've recently started replacing standard WPF controls with their Telerik counterparts in our project and we've noticed that Telerik menu items are not visible at design time where the standard WPF menu items are. Is this a bug?

 

Vicky
Telerik team
 answered on 16 Jul 2019
2 answers
654 views

I am working on some legacy code, I have RadTreeView with Item template which expand the hierarchy at doubleclick, I want to add a contextmenu which expand the hierarchy in the same way, problem is that there is no command to bind to expand nodes. How can I have the context menu work in the same way as the itemtemplate?

 

<p></p><p>                <telerik:RadTreeView Grid.Row="2" Background="White" BorderBrush="DarkGray" BorderThickness="1" VerticalAlignment="Stretch"<br>
                                         Name="ResultSetReportTreeView"<br>
                                         IsVirtualizing="True" <br>
                                         ItemDoubleClick="RadTreeViewItemDoubleClick"<br>
                                         Width="{Binding ElementName=GuideControl, Path=ActualWidth}"<br>                                         ItemContainerStyle="{StaticResource ResourceKey=HierarchyTreeViewStyle}"<br>                                         SelectedItem="{Binding Path=SelectedNode, Mode=TwoWay}"<br>
                                       ItemsSource="{Binding ResultSetReportNodes}"<br>
                                         SelectionMode="Single" ><br>
                    <br>                    <telerik:RadTreeView.Resources><br>
                        <Style TargetType="{x:Type telerik:RadTreeViewItem}"><br>
                            <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}" /><br>
                        </Style><br>
                    </telerik:RadTreeView.Resources><br>
                    <telerik:RadTreeView.ItemTemplate><br>
                        <HierarchicalDataTemplate ItemsSource="{Binding Path=Children}"><br>
                            <StackPanel Orientation="Horizontal" Background="Transparent" ToolTip="{Binding Path=Name, Mode=OneWay}"><br>
                                <Image Style="{StaticResource ResourceKey=IconStyle}" VerticalAlignment="Center" Margin="5,0,0,0"/><br>
                                <TextBlock Text="{Binding Path=Name}" ToolTip="{Binding Path=Name, Mode=OneWay}" Margin="5,0,0,0"/><br>
 <!--start of my Context menu--><br>
                                <StackPanel.ContextMenu><br>
                                    <ContextMenu><br>                                        <!--ExpandAllDescendantFoldersCommand IsCheckable=" empty I need it to work as itemtemplate does at doubleclick"--><br>                                        <MenuItem Header="{localization:Resx ResxName=Palantir.CommonResources.ButtonLabels, Key=Expand}" Command="{Binding Path=PlacementTarget.Tag.ExpandAllDescendantFoldersCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContextMenu}}, Mode=OneWay}"><br
                                      </MenuItem><br>
                                    </ContextMenu><br>
                                </StackPanel.ContextMenu><br>
                            </StackPanel><br>
 <!--End of my Context menu--><br>
                        </HierarchicalDataTemplate><br>
                    </telerik:RadTreeView.ItemTemplate><br>
                </telerik:RadTreeView><br>
            </Grid><br>
        </telerik:RadExpander><br></p>

 

Ignazio
Top achievements
Rank 1
 answered on 15 Jul 2019
4 answers
1.6K+ views

Hello,

I have the following requirements:

  • When the user enters from outside the grid into the empty grid a new row should be created and the second cell should be selected in edit mode.
  • When the user enters from outside the grid into a grid with existing rows, the second cell should be selected in edit mode.

I am using the enter-key to move to the next field in a particular viewmodel, instead of the tab-key.

How can I accomplish this, I tried searching a solution but couldnt find anything that accomplish this when entering the grid from outside?

 

Any help would be greatly appreciated.

Marcel

Ras Ran
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 15 Jul 2019
4 answers
3.8K+ views

Hi, 

I'm trying to set the background color for a disabled MultiColumnComboBox using a style, without succes.  Here's my code

<Style x:Key="DefaultTelerikRadMultiColumnComboBoxStyle" TargetType="telerik:RadMultiColumnComboBox" BasedOn="{StaticResource RadMultiColumnComboBoxStyle}">
    <Setter Property="FontFamily" Value="{StaticResource DefaultFont}"/>
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSize}"/>
    <Setter Property="FontWeight" Value="{StaticResource DefaultFontWeight}"/>
    <Setter Property="MinHeight" Value="{StaticResource DefaultMinimumHeight}"/>
    <Setter Property="KeepDropDownOpen" Value="False"/>
    <Setter Property="CloseDropDownAfterSelectionInput" Value="True"/>
    <Setter Property="SelectionBoxesVisibility" Value="Visible"/>
 
    <Setter Property="Validation.ErrorTemplate" Value="{StaticResource ErrorTemplate}"/>
 
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="True">
            <Setter Property="Background" Value="{StaticResource DefaultTextBoxBackgroundColor}"/>
        </Trigger>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="WhiteSmoke"/>
        </Trigger>
        <Trigger Property="IsFocused"  Value="True">
            <Setter Property="Background"  Value="{StaticResource DefaultTextBoxIsFocusedBackgroundColor}"/>
        </Trigger>
    </Style.Triggers>
</Style>
<Style TargetType="{x:Type telerik:RadMultiColumnComboBox}" BasedOn="{StaticResource DefaultTelerikRadMultiColumnComboBoxStyle}"/>

 

Any ideas ?

Regards
Hans

Dimitar Dinev
Telerik team
 answered on 15 Jul 2019
6 answers
3.5K+ views

I have a radcombobox that has a list of checkboxes that has multiselect. 

-- template for the checkbox
<UserControl.Resources>
        <DataTemplate x:Key="MultiSelectComboTemplate">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
 
                <StackPanel Orientation="Horizontal">
                    <CheckBox x:Name="checkbox" IsChecked="{Binding IsSelected}" Command="{Binding ElementName=_cboTeams, Path=DataContext.SelectCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type telerik:RadComboBox}}}"/>
                     
                    <TextBlock Text="{Binding Name}" Margin="5 0 0 0"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
        <CollectionViewSource x:Key="teams" Source="{Binding Teams}"/>
         
    </UserControl.Resources>

 

-- radcombobox
 <telerik:RadComboBox x:Name="_cboTeams"  Grid.Row="1" Grid.Column="2" Margin="5 0 5 0" Width="120"
                             SelectedValuePath="Id"
                             ItemsSource="{Binding Teams}"
                             AllowMultipleSelection="True"
                             ItemTemplate="{StaticResource MultiSelectComboTemplate}"
                             DropDownClosed="_cboTeams_DropDownClosed"
                             Command="{Binding ElementName=_cboTeams, Path=DataContext.SelectCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}">
        </telerik:RadComboBox>

 

Two questions. 

 

1. I find that I need to get the most current item selected. With that said, how do I get the most current row(either by Id or by Index)

 

2. Second, my radcombobox has two types of "events" i need to worry about. One is when the row is clicked and highlighted and another one when user clicks the checkbox itself. If I click the row , I manually search for the item on the Viewmodel and mark the item checked to check the checkbox of that row. My issue is, if the user clicks the checkbox, I can trigger the command of the viewmodel and I will pass the s

 

private void OnSelect(object sender)
        {           
            if (sender is CheckBox)
            {
                var obj = sender as CheckBox;
                var team = (LabeledValueCheckBox)obj.DataContext;
                if (team.IsSelected)
                {
                    if (team.Id == 0)
                    {
                        foreach (var t in this.Teams)
                        {
                            t.IsSelected = true;
                        }
                    }
                }
                else
                {
                    foreach (var t in this.Teams)
                    {
                        t.IsSelected = false;
                    }
                }
            }
            else
            {
                var obj = sender as RadComboBox;
                var contxt = (AddFirmViewModel)obj.DataContext;
                var selectedTeams = obj.SelectedItems;
 
                if(obj.SelectedItems == null)
                {
                    foreach(LabeledValueCheckBox t in obj.ItemsSource)
                    {
                        if (t.IsSelected)
                        {
                            selectedTeams.Add(t);
                        }
                    }
                }
 
 
 
                if (selectedTeams != null)
                {
                    if (selectedTeams.Contains(contxt.Teams[0]))// select all
                    {
                        foreach (var t in contxt.Teams)
                        {
                            t.IsSelected = true;
                            selectedTeams.Add(t);
                        }
                    }
                    else
                    {
                        foreach (var t in contxt.Teams)
                        {
                            var exists = selectedTeams.Contains(t);
 
                            if (exists)
                            {
                                t.IsSelected = true;
                            }
                            else
                            {
                                t.IsSelected = false;
                            }
                        }
                    }
                }
            }
             
             
            SelectPressed?.Invoke(this, new EventArgs());
        }

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 15 Jul 2019
2 answers
131 views

Hi,

I'm trying to change the borderbrush of the Dockresizer.

What I found out, is that the dockresizer is part of the RadSplitContainer.

I cannot create a template copy of that control because Blend throws an error (btw. I can create copies of other telerik controls like documentmanager).

Any ideas?

 

Dietmar
Top achievements
Rank 1
 answered on 15 Jul 2019
1 answer
99 views
Is it possible to allow only list entries for the RadAutoCompleteBox? As Items Source I have bound an ObservableCollection.
Harald
Top achievements
Rank 2
 answered on 14 Jul 2019
1 answer
268 views

Hello,
I would like to ask about context menu of PDF viewer.

So, I have PDF viewer (which is located in some UserControl), it works fine. In my app I allow to user creating of custom bookmarks - just some name and page number. One of the ways, how can user create own bookmark - right click and choose create bookmark in context menu. To create this I would like to use custom RelayCommand, which is in ViewModel of MainWindow and also uses some properties from ViewModel of MainWindow.

So, there is some problem. Since PdfViewer has it own DataContext (Command Descriptors), I can't use PlacementTarget to get some information from Window/UserControl DataContext (I tried relative source - it doesn't work). I found a solution - I created addition class with own RelayCommand, that works with STATIC variables (instance of PDF viewer to get current page) and methods (to create bookmark) from ViewModel. But I really dont like it really this solution.

So, I would like to ask you, how can I use my custom command from ViewModel in context menu of Pdf viewer? Or at least how can I pass CurrentPageNumer as argument, when I click on my custom menu item (command from custom class, which is initialized as static resource) in contextmenu of PDFviewer?

Now it looks like that:
<telerik:RadMenuItem Header="Create Custom Bookmark" Command="{Binding SomeCommand, Source={StaticResource customClass}}"    
                                                 Visibility="Visible" >

Thank you in advance!
Best regards,
Alexander

Georgi
Telerik team
 answered on 12 Jul 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?