Telerik Forums
UI for WPF Forum
133 answers
920 views

RadCalendar:

RadDiagram:

  • Create custom shapes in the RadDiagram with MVVM - The forum thread elaborates on how to create custom shapes in the RadDiagram following an MVVM approach.
  • Populate the RadDiagramToolbox with custom business data - In this forum thread you can find a sample solution and guidelines on how to populate the RadDiagramToolbox with custom business data and based on the data type drop different objects on the diagramming surface. The attached solution also demonstrates an approach for providing custom information in a SettingsPane tab.
RadGridView:
  • Unfocused state for the selected GridViewRow - With Q2 2012 we have introduced a new Unfocused state for the selected GridViewRow. It will be shown when the GridView is out of focus. If you want to revert to the previous behavior you can check this help article.
RadPivotGrid: RadRichTextBox:
  • Guidelines for Printing with RadDocument - As RadDocument is sometimes used independently of RadRichTextBox to layout content and export it, this article explains the basics of creating a document programmatically.
Dinko
Telerik team
 answered on 23 Feb 2018
0 answers
2 views

Hey. Is there anyway that I can deploy the application without ClickOnce or any Installation but just copy the compiled file to the client machine?

Our company has very complicated and tedious IT process. The best one to deploy the project is just to copy the app to the client machine and run it.

BTW, it is .net core 3.1 WPF APP.

gary
Top achievements
Rank 1
 updated question on 09 May 2021
2 answers
6 views

Hi,

I have a step line chart with the trackball enabled. The ChartTrackBallBehavior is like this.

<telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" ShowTrackInfo="True" SnapMode="None" SnapSinglePointPerSeries="True"/>

 

My problem is that the closest point can be on the left or on the right of the trackball line. I need the closest point to be always the one on the left. Is there a way to change the default behavior so that I can programmatically set the closest point when trackball line moves? I have attached an image to better explain my problem.

 

 

Stefano
Top achievements
Rank 1
Iron
 answered on 07 May 2021
2 answers
4 views

Hello,

If we follow the WPF good practices, the `OnLostFocus` method must be called when the control loses focus and it's the job of this method to raise the `LostFocus` event.

In the case of the AutoCompleteBox, the event is raised, but the method is not called. So it's not possible to do some work before the event is raised.

Patrick
Top achievements
Rank 2
Iron
 answered on 07 May 2021
2 answers
7 views

 

Hello,

I have a problem to get the SelectedItems from my radcombobox. I have created an attached property "SelectedItemsHelper" to use the "SelectedItems" property. As a template for the attached property, I 've used this blog post.

My SelectedItemsHelper

using System.Collections;
using System.Windows;
using Telerik.Windows.Controls;

namespace WpfAutoQuery
{
    public class SelectedItemsHelper
    {
        
        public static readonly DependencyProperty SelectedItemsProperty =
            DependencyProperty.RegisterAttached("SelectedItems", typeof(IList), typeof(SelectedItemsHelper), new FrameworkPropertyMetadata((IList)null, new PropertyChangedCallback(OnSelectedItemsChanged)));
              
        public static IList GetSelectedItems(DependencyObject d)
        {
            return (IList)d.GetValue(SelectedItemsProperty);
        }

        public static void SetSelectedItems(DependencyObject d, IList value)
        {
            d.SetValue(SelectedItemsProperty, value);
        }

        private static void OnSelectedItemsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var comboBox = sender as RadComboBox;
            if (comboBox != null)
            {                
                IList selectedItems = GetSelectedItems(comboBox);
                if(selectedItems != null)
                {
                    comboBox.SelectedItems.Clear();
                    foreach (var item in selectedItems)
                    {
                        comboBox.SelectedItems.Add(item);
                    }
                }
            }                               
        }
    }
}

My RadComboBox:

<telerik:RadComboBox Name="rcbSection" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" Margin="10" IsEditable="False"
                                       ItemsSource="{Binding Sections}" DisplayMemberPath="Line1" AllowMultipleSelection="True"  
                                       local:SelectedItemsHelper.SelectedItems="{Binding SelectedSections}">                                              
</telerik:RadComboBox>

My "SelectedSections" property in ViewModel

public ObservableCollection<Section> SelectedSections
            {
                get { return GetPropertyValue<ObservableCollection<Section>>(); }
                set { SetPropertyValue(value); }
            }

I have added a jpg, where you can see that i dont get my selected values... Does someone can help me? I dont know what i do wrong...

 

Vladimir Stoyanov
Telerik team
 answered on 07 May 2021
3 answers
13 views

Hello.

 

When we debug or Run the application it works fine but in output window so many lines are coming with warning 

 

 

 

System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AlternativeBrush'; ResourceKey.HashCode='18573990'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='AlternativeBrush'; ResourceKey.HashCode='18573990'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='BasicBrush'; ResourceKey.HashCode='1723761'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'
System.Windows.ResourceDictionary Warning: 9 : Resource not found; ResourceKey='MarkerBrush'; ResourceKey.HashCode='35310062'; ResourceKey.Type='Telerik.Windows.Controls.FluentResourceKey'

 

When an item is clicked on the parent grid view, the child grid view list is displayed.

Style is not used anywhere. This warning occurs at this time.

 

Implicit noxaml is in use and is version 2021.1.419.45. (Theme :Fluent)

 

 

Thanks.

Psyduck
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 07 May 2021
0 answers
3 views

I have recently been developing a radtreeview and needed the facility to only drop inside a folder, therefore eliminating the requirement for drop before and after. The link above resolved this issue, thank you, though I can still see the graphical orange indicator (line with circle) which is associated with the drop position.

Is it possible to disable this indicator as well?

As an aside issue, it appears that I get highlighted textblocks remaining behind after moving nodes around see the attached image. Do you have advice as to what could cause this?

tree-image

Matthew
Top achievements
Rank 1
 asked on 06 May 2021
2 answers
6 views

Dear Team,

In old times i used this code to have a custom sort on a datagridview:

    Private Sub DG_RM_SortCompare(sender As Object, e As DataGridViewSortCompareEventArgs) Handles DG_RM.SortCompare
        '''' <summary>Gets or sets a value indicating the order in which the compared cells will be sorted.</summary>
        '''' <returns>Less than zero if the first cell will be sorted before the second cell; zero if the first cell and second cell have equivalent values; greater than zero if the second cell will be sorted before the first cell.</returns>
        If e.Column.Index > 2 Then
            Try
                If e.CellValue1 Is Nothing OrElse e.CellValue1.Equals(DBNull.Value) Then
                    If e.CellValue2 Is Nothing OrElse e.CellValue2.Equals(DBNull.Value) Then
                        e.SortResult = 0
                    Else
                        e.SortResult = 1
                    End If
                Else
                    If e.CellValue2 Is Nothing OrElse e.CellValue2.Equals(DBNull.Value) Then
                        e.SortResult = -1
                    Else
                        e.SortResult = DirectCast(e.CellValue1, IComparable).CompareTo(DirectCast(e.CellValue2, IComparable))
                    End If
                End If
                e.Handled = True

            Catch ex As Exception
                MsgBox(Err.Description)
                Close()
            End Try
        End If
    End Sub

Now i need to achieve the same in WPF radgridview.. I have columns, with positive integers, zeroes and NULLs too.

Basically if i order : NULLs come first , then zeroes, then numbers ASC.

In my case customer needs to see in this way: zeroes, positive numbers asc, and nulls at the end.

The datasource is a datatable passed to radgridview as itemsource, and the column names (and number of them) are always dynamic, so i cannot predefine them in the XAML section. Please help

Thanks!

Peter B. (Hungary)

 

Peter
Top achievements
Rank 1
Iron
 answered on 06 May 2021
1 answer
12 views

Hi,

We ended up giving up on this issue a while back, but we are back trying to solve it, and I am wondering if there is any new way that we could set the order that Containers appear in the diagram.

We have a RadDiagram with several rectangular containers which contains several hexagons inside of them. we can easily place the hexagons wherever we want, but we cannot assure that the containers are displayed in an order we want.

We can easily do that for shapes, however whenever we bind to the position of a container, the binding gets overridden with (0,-26).

What we want is to be able to display containers on the diagram, ordered by the container's display header. From Left to right, top to bottom. Is that possible?


This is roughly what we are using:


Diagram:

<RadDiagram 
                                                    MinWidth="500"
                                                    IsPanEnabled="True"
                                                    ContainerShapeStyle="{StaticResource ContainerStyle}"
                                                    ShapeStyle="{StaticResource ShapeStyle}"
                                                    Style="{StaticResource RadDiagramStyle}"
                                                    PreviewMouseMove="diagram_PreviewMouseMove"
                                                    Grid.Row="0"
                                                    telerik:DiagramSurface.IsVirtualizing="True"
                                                    ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                                                    ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                                    Background="{DynamicResource RadDiagram_Base_Normal_Background}"
                                                    IsSnapToGridEnabled="False"
                                                    IsConnectorsManipulationEnabled="False"
                                                    SelectionMode="None"
                                                    IsSnapToItemsEnabled="False"
                                                    IsInformationAdornerVisible="False"
                                                    telerik:DiagramAnimations.IsPanAnimationEnabled="False"
                                                    telerik:DiagramAnimations.IsZoomAnimationEnabled="False"
                                                    IsZoomEnabled="True"
                                                    AllowDelete="False"
                                                    IsEditable="False"
                                                    AllowPaste="False"
                                                    Primitives:BackgroundGrid.IsGridVisible="False"
                                                    AutoLayout="False"
                                                    Primitives:BackgroundPageGrid.IsGridVisible="False"
                                                    GraphSource="{Binding Nodes, Mode=OneWay}"/>


Container Style:

<Style x:Key="ContainerStyle"
           TargetType="telerik:RadDiagramContainerShape"
           BasedOn="{StaticResource RadDiagramContainerShapeStyle}">
      <Setter Property="Position"
              Value="{Binding Position, Mode=TwoWay}" />
      <Setter Property="AllowDelete"
              Value="False"/>
      <Setter Property="IsCollapsible"
              Value="{Binding IsHidden, Mode=OneTime}"/>
      <Setter Property="CollapsedContent"
              Value=""/>
      <Setter Property="UseDefaultConnectors"
              Value="False"/>
      <Setter Property="UseGlidingConnector"
              Value="False"/>
      <Setter Property="IsConnectorsManipulationEnabled"
              Value="False"/>
      <Setter Property="IsEditable"
              Value="False"/>
      <Setter Property="IsRotationEnabled"
              Value="False"/>
      <Setter Property="IsResizingEnabled"
              Value="False"/>
      <Setter Property="AllowCut"
              Value="False"/>
      <Setter Property="IsDraggingEnabled"
              Value="False"/>
      <Setter Property="ToolTip"
              Value="{Binding Details}"/>
      <Setter Property="ToolTipService.IsEnabled"
              Value="False" />
      <Setter Property="Background"
              Value="Red"/>
      <Setter Property="HorizontalContentAlignment"
              Value="Left"/>
      <Setter Property="BorderBrush"
              Value="Transparent"/>
      <Setter Property="IsCollapsed"
              Value="{Binding IsHidden, Mode=TwoWay}"/>
      <Setter Property="ContentTemplate">
        <Setter.Value>
          <DataTemplate>
            <TextBlock x:Name="HeaderText"
                       Foreground="{DynamicResource FocusAttentionGroupForegroundBrush}"
                       Text="{Binding Content}"
                       Background="Transparent"/>
          </DataTemplate>
        </Setter.Value>
      </Setter>
    </Style>

Martin Ivanov
Telerik team
 answered on 06 May 2021
0 answers
5 views

I have a RadDocking element in my xaml. I need to add one main button that opens and closes the main menu above the RadDocking element.

The problem is, the RadPane-s that open inside the RadDocking element would go below the button and the title of a given RadPane is hidden.

I want my main button to be above the RadDocking element, but the header/title of all the panes should be at all time visible and not hidden by the button.

I was wondering, can there be some constrained area inside RadDocking tag where RadPanes would not go or cover, so I can place my button above the RadDocking in that area?

Seems a bit non-sense but there has to be a way.

Should I use conditional docking? But how would that work, mark each new pane with a tag and then choose HeaderTemplate with HeaderTemplateSelector whether to add or not, space to the left in the RadPane header?

Vladimir
Top achievements
Rank 1
 asked on 05 May 2021