Telerik Forums
UI for WPF Forum
8 answers
180 views

I was surprised to find that assigning a foreground color to a LinearAxis3D does not automatically make the axis line, title or labels take on that color.  That was the behavior I would expect.  But it does not. 

Ok, no problem, I figured I would get around it by defining a style resource for LinearAxis3D that individually binds the color to its logical children to the parent LinearAxis3D.    So I did that and it works just fine for the text title and labels.  But it does not work for the axis line

Are a LinearAxis3D object's axis lines not logical children of that axis?  And if not, is there any way to generically find the LinearAxis3D object for (binding purposes) from within the style?

To illustrate, here's a the Z axis on my chart.  (I've nested the style here for simplicity but in my app it needs to be a separate static resource for re-use.)

<tk:RadCartesianChart3D.ZAxis>
    <tk:LinearAxis3D
        x:Name="ZAxis"
        LabelFormat="0.00"
        SmartLabelsMode="SmartStep"
        Minimum="{Binding ZAxisMin}"
        Maximum="{Binding ZAxisMax}"
        Foreground="Yellow"
        >
        <tk:LinearAxis3D.Style>
            <Style TargetType="{x:Type tk:LinearAxis3D}">
                <Setter Property="LabelStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type tk:LinearAxis3D}}, Path=Foreground}"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="LineStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Path}">
                            <Setter Property="Stroke" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type tk:LinearAxis3D}}, Path=Foreground}"/>
                            <Setter Property="StrokeThickness" Value="2"/>
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
        </tk:LinearAxis3D.Style>
    </tk:LinearAxis3D>
</tk:RadCartesianChart3D.ZAxis>

Since I assigned "Yellow" to the LinearAxis3D.Foreground, my label text blocks manage to find the parent LinearAxis3D and bind to this property to show the correct label color.  But the axis lines never show up.  That binding never finds the LinearAxis3D and so never gets any color. 

If I change this setter to just use a hard coded color then it setter works fine.  But obviously, that's not going to work for me.

Surprisingly, when I tried -- just as a test -- to bind by ElementName to "ZAxis", that didn't work either.  It's not an option for me if I want this Style to be a StaticResource but still I was surprised it did not work.

So do I have any other option here?  Is the Path object used to draw the axis line a logical child of the LinearAxis3D?  And if not, is there any way to achieve what I want?  Or do I need to just  individually nest the line style for each axis?


 

Martin Ivanov
Telerik team
 answered on 26 Nov 2019
1 answer
185 views

Hello,

The documentation for RadMap doesn't show all the resource keys for the control.

At least, the following resource keys are not defined:

  • MapNorthChar
  • MapSouthChar
  • MapWestChar
  • MapEastChar
  • MapMapScaleMeterFormat
  • MapOsmStandardCommand
  • MapOsmCycleCommand
  • MapOsmTransportCommand
  • MapOsmHumanitarianCommand
  • MapPhysicalCommand
  • MapShadedReliefCommand
  • MapTerrainBaseCommand
  • MapTopographicCommand

Please update the documentation with ALL resource keys with the default values.

Dinko | Tech Support Engineer
Telerik team
 answered on 26 Nov 2019
1 answer
291 views

I am using the telerik.RadTreeView in my WPF-Application.

Beginning of september I updated the Telerik.Windows.Controls (current version is 2019.1.114.45, unfortunately, I can not say right now which version it was before).

Now we have found out, that since these update, the SelectionChanged event is no longer triggered by touch if ScrollViewer.PanningMode="VerticalOnly" is set. Mouseclicking still triggers the event.

Since this is some old (and not my code), removing ScrollViewer.PanningMode="VerticalOnly" solved this problem and I can't figure out a different behavior for scrolling, so i can go with that.

I would still be interested, if you can tell me,why this error occurred.

Best regards

 

 

Dilyan Traykov
Telerik team
 answered on 25 Nov 2019
8 answers
691 views

Hi,

I'm facing one issue and I really do not know where could the problem.

 

It's once again (as I read few other posts in the forum, nothing new) related to persisting order of columns in GridView. My problem happens only when the columns get reordered by drag-n-drop. When I add and or remove columns (this is done programatically in my view's code-behind) and try to persists Grid's state, everything works well. Unless I reorder their sequence.

 

 

It's worth mentioning that I'm persisting the state in my filesystem so that I could restore it later. Solution with IsolatedStorageProvider is not well suited for me. But I do not think that this should be any issue.Storage happens everytime the button 'Save layout' is being clicked.

 

I have created sample video that shows what I'm trying to say maybe even more expressively. Look here.I have created sample video that shows what I'm trying to say maybe even more expressively. Look here - https://drive.google.com/file/d/0B0cxhvgqPibkNHhyUzM1TVVHOVU/view

 

I have implemented my version of ICustomPropertyProvider, but it's almost identical to the one provided in WPF Control Examples. See here:

 

public class GridViewCustomPropertyProvider : ICustomPropertyProvider
    {

        private const string _columnsProperty = "Columns";
        private const string _sortDescriptorsProperty = "SortDescriptors";

        public CustomPropertyInfo[] GetCustomProperties()
        {
            return new CustomPropertyInfo[]
            {
                new CustomPropertyInfo(_columnsProperty, typeof(List<ColumnProxy>)), 
                new CustomPropertyInfo(_sortDescriptorsProperty, typeof(List<SortDescriptorProxy>)), 
            };
        }

        public void InitializeObject(object context)
        {
            if (context is RadGridView)
            {
                RadGridView gridView = context as RadGridView;
                //gridView.Columns.Clear();
                gridView.SortDescriptors.Clear();
                foreach (GridViewColumn gridViewColumn in gridView.Columns)
                {
                    gridViewColumn.ClearFilters();
                }
            }
        }

        public object InitializeValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            return null;
        }

        public void RestoreValue(CustomPropertyInfo customPropertyInfo, object context, object value)
        {
            RadGridView gridView = context as RadGridView;

            switch (customPropertyInfo.Name)
            {
                case _sortDescriptorsProperty:

                    gridView.SortDescriptors.SuspendNotifications();
                    gridView.SortDescriptors.Clear();

                    List<SortDescriptorProxy> proxies = value as List<SortDescriptorProxy>;

                    foreach (SortDescriptorProxy proxy in proxies)
                    {
                        GridViewColumn column = gridView.Columns[proxy.ColumnName];
                        gridView.SortDescriptors.Add(new ColumnSortDescriptor(){Column = column, SortDirection = proxy.SortDirection});
                    }

                    gridView.SortDescriptors.ResumeNotifications();

                    break;

                default:

                    var columnProxies = value as List<ColumnProxy>;
                    //var orderedColumns = columnProxies.OrderBy(x => x.DisplayIndex);

                    foreach (ColumnProxy columnProxy in columnProxies)
                    {
                        GridViewColumn gridColumn = gridView.Columns[columnProxy.UniqueName];
                        gridColumn.DisplayIndex = columnProxy.DisplayIndex;
                        gridColumn.Header = "blabhalbl" + columnProxy.Header;
                        gridColumn.Width = columnProxy.Width;
                        //gridView.Columns.Add(gridColumn);
                    }

                    break;
            }
        }

        public object ProvideValue(CustomPropertyInfo customPropertyInfo, object context)
        {
            RadGridView gridView = context as RadGridView;

            var orderedColuns = OrderedColumns(gridView);

            switch (customPropertyInfo.Name)
            {

                case _sortDescriptorsProperty:
                    {
                        List<SortDescriptorProxy> sortDescriptorProxies = new List<SortDescriptorProxy>();

                        foreach (ColumnSortDescriptor descriptor in gridView.SortDescriptors)
                        {
                            sortDescriptorProxies.Add(new SortDescriptorProxy()
                            {
                                ColumnName = descriptor.Column.UniqueName,
                                SortDirection = descriptor.SortDirection,
                            });
                        }

                        return sortDescriptorProxies;
                    }


                default:

                    var columns = new List<ColumnProxy>();
                    foreach (GridViewColumn column in orderedColuns.OrderBy(x => x.DisplayIndex))
                    {
                        columns.Add(new ColumnProxy()
                        {
                            UniqueName = column.UniqueName,
                            Header = column.Header.ToString() + "someother",
                            DisplayIndex = column.DisplayIndex,
                            Width = column.Width
                        });
                    }

                    return columns;
            }
        }

        private static List<GridViewColumn> OrderedColumns(RadGridView gridView)
        {
            var orderedList = new List<GridViewColumn>();

            for (int i = 0; i < gridView.Columns.Count; i++)
            {
                orderedList.Add(gridView.Columns[i]);
            }
            return orderedList;
        }
    }

 

Thanks in advance for any piece of advice,

Erik

Hans
Top achievements
Rank 1
Veteran
 answered on 25 Nov 2019
3 answers
330 views

Hello. 

It seems like there is no  RTB assembly for .NET 4.7.2

Any advise on how to get it from NuGet?

The steps to setup nuget feed and dependent assemblies was taken from the documentation.

 

 

 

Dimitar
Telerik team
 answered on 25 Nov 2019
5 answers
202 views

Hi, I want to change my GridViewCell FocusBrush, I try this but don't work:

 

    <Style TargetType="{x:Type telerik:GridViewCell}" BasedOn="{StaticResource GridViewCellStyle}">
        <Setter Property="materialControls:MaterialAssist.PressedBrush" Value="{StaticResource BaseColor}"/>
        <Setter Property="materialControls:MaterialAssist.FocusBrush" Value="{StaticResource BaseColor}"/>
        <Setter Property="materialControls:MaterialAssist.MouseOverBrush" Value="{StaticResource BaseColor}"/>
    </Style>

 

I want to change Line's color bottom of cell

 

 

Mahdi
Top achievements
Rank 1
 answered on 25 Nov 2019
3 answers
294 views
I want to reorder the  the items in RadListbox thru DragDropManager. Any example?
Dilyan Traykov
Telerik team
 answered on 21 Nov 2019
1 answer
240 views

WPF RadGrid ClipboardCopyMode Row and Cell 

Can we differentiate when we copy entire row or a single cell?

 

For Row selection we need row values with headers. Sp using these properties we can include headers too ClipboardCopyMode="All" CopyingCellClipboardContent="

 

For cell copying can we ignore the header? 

 

Dilyan Traykov
Telerik team
 answered on 21 Nov 2019
1 answer
179 views

Hi,

    I created a project that wanted to implement custom connections and implemented mvvm. But I ran into a problem, the connection line position changed when I reopened the Diagram after saving. Figure 1 is before saving, and Figure 2 is opened after saving. I set the SourceConnectorPosition and TargetConnectorPosition properties as follows:
<Style TargetType="{x:Type telerik:RadDiagramConnection}" x:Key="CommonDiagramConnectionStyleBase" BasedOn="{StaticResource RadDiagramConnectionStyle}">
        <Setter Property="SourceCapType" Value="{Binding SourceCapType, Mode=OneWayToSource}" />
        <Setter Property="TargetCapType" Value="{Binding TargetCapType, Mode=OneWayToSource}" />
        <Setter Property="Visibility" Value="{Binding Visibility, Mode=OneWayToSource}" />
        <Setter Property="Position" Value="{Binding Position, Mode=OneWayToSource}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=OneWayToSource}" />
        <Setter Property="SourceConnectorPosition" Value="{Binding SourceConnectorPosition, Mode=TwoWay}" />
        <Setter Property="StartPoint" Value="{Binding StartPoint, Mode=TwoWay}" />
        <Setter Property="TargetConnectorPosition" Value="{Binding TargetConnectorPosition, Mode=TwoWay}" />
        <Setter Property="EndPoint" Value="{Binding EndPoint, Mode=TwoWay}" />
        <Setter Property="ZIndex" Value="{Binding ZIndex, Mode=OneWayToSource}" />
        <!--<Setter Property="Background" Value="{StaticResource DiagramShape_Connection_Background}" />
        <Setter Property="Stroke" Value="{StaticResource DiagramShape_Connection_BorderBrush}" />
        <Setter Property="StrokeThickness" Value="1" />
        <Setter Property="ZIndex" Value="{StaticResource connectionZIndex}" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <c:If Condition="WPF">
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        </c:If>-->
    </Style>


Dinko | Tech Support Engineer
Telerik team
 answered on 21 Nov 2019
1 answer
186 views

Hello,

For other controls, there is an page in the help file for the localization of the control, listing the resource keys.

There is no such information for RadWindow.

Can you give us the resource keys?

Dimitar Dinev
Telerik team
 answered on 20 Nov 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?