Telerik Forums
UI for WPF Forum
4 answers
104 views

I am using the savelayout and loadlayout functions to save and load dock layout. This is working as expected.

The issue I'm having is where I should put the loadlayout code in the page lifecycle. 

If I add the load function to the constructor as expected the layout is ignored and the default is used. If I add the load function to the contentrendered code the user see's the dock jerk from one layout to another. 

Ideally I don't want the user to see the move from default to loaded layouts.

Can you explain how I achieve this please?

Many thanks

R

Dilyan Traykov
Telerik team
 answered on 09 Apr 2019
1 answer
248 views

Hi guys, 

I'm trying to decrease the GanttView row height, I'm using the Material Theme and I'm able to do it.

 

I already set this style on my xaml without luck

 

<sys:Double x:Key="RowHeight">8</sys:Double>

                                    <Style TargetType="telerik:SimpleCellContainer" BasedOn="{StaticResource SimpleCellContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellContainer" BasedOn="{StaticResource CellContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellEditingContainer" BasedOn="{StaticResource CellEditingContainerStyle }">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:SimpleTreeCellContainer" BasedOn="{StaticResource SimpleTreeCellContainerStyle }">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:DragResizeSlotHighlightContainer" BasedOn="{StaticResource DragResizeSlotHighlightContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>
                                    <Style TargetType="telerik:CellHighlightContainer" BasedOn="{StaticResource CellHighlightContainerStyle}">
                                        <Setter Property="MinHeight" Value="{StaticResource RowHeight}" />
                                    </Style>

 

Someone can help me?

 

Best regards

Enrico

Dilyan Traykov
Telerik team
 answered on 09 Apr 2019
1 answer
99 views

I'm struggling to style the MapCommandBar because I can't find the properties referred to in the Styling the MapCommandBar article e.g. MapButtonBackground. Where can I set that? It doesn't exist in the generated default MapCommandBar or RadMap style templates 

Thanks,

Simon

Vladimir Stoyanov
Telerik team
 answered on 09 Apr 2019
1 answer
214 views
I've been using the UI for WPF with the regular binaries and the StyleManager for a while.  Today I took a shot at switching to the NoXaml binaries.   Unfortunately my change has broken all of the custom styles I myself made for Telerik controls.  Specifically, the XAML parser blows up when it see me attempting to base my style on the default one like this:

<Style TargetType="{x:Type tk:RadRadioButton}"
   BasedOn="{StaticResource {x:Type tk:RadRadioButton}}">
    <Setter Property="CornerRadius" Value ="3"/>
</Style>


The "BasedOn" clause causes the problem.  I get the dreaded "Provide Value on StaticResourceHolder" error.  It would appear it cannot locate that default style for RadRadioButton on which I am trying to base my style.

Can you help me figure out further I need to do to make these styles work again?


I tried to follow the instructions here:

https://docs.telerik.com/devtools/WPF/styling-and-appearance/styling-apperance-setting-a-theme-overview

I removed all assembly references from the regular binaries and replaced them with references to the NoXaml equivalents.

Instead of copying the XAML files, I tried the approach that says to reference a theme from the /Binaries/NoXaml folder.

And since I am using the Windows8Touch, I m

https://docs.telerik.com/devtools/WPF/styling-and-appearance/themes-suite/common-styles-appearance-colorizing-metro-theme

And so I did this at the start of my application resources in App.xaml


<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <tk:Windows8ResourceDictionary/>
            <tk:Windows8TouchResourceDictionary/>



Am I missing something?
Dinko | Tech Support Engineer
Telerik team
 answered on 08 Apr 2019
4 answers
102 views

Hi there,

 

Somehow I need to get old parent and new parent of a task after reordering it, but I can't find any event for that purpose. Can anyone help me with that please?

 

Thanks,

Developer1992

Bahram
Top achievements
Rank 1
 answered on 06 Apr 2019
2 answers
240 views

Hello,

I have been examining the Telerik source code and notice several anti-patterns related to automation peers. For several controls, the automation peers have function overrides that return unhelpful strings. One example is the RadGridViewAutomationPeer GetHelpTextCore method returns "RadGridView". Because of this, it's impossible to set help text for individual grids in XAML which is the default behavior of the GridViewDataControlAutomationPeer. Even though the RadGridViewAutomationPeer can be inherited from and its GetHelpTextCore method modified, not all Telerik automation peers are overridable. GridViewCell and GridViewRow for example require internally scoped properties and can't be overridden.

Right now I am able to bypass these issues by making the changes to the source code and recompiling it, but this is not a long term sustainable solution. Does Telerik have any sort of road map available for addressing automation peer issues?

Bryan
Top achievements
Rank 1
 answered on 05 Apr 2019
5 answers
216 views

Hi,

I was trying to add a qr into a RadFixedDocument like this

RadBarcodeQR qr = new RadBarcodeQR();
qr.Mode = QRClassLibrary.Modes.CodeMode.Byte;
qr.Text = documentHistory.SerialId.ToString();
qr.Width = 88;
qr.Height = 88;
using (MemoryStream stream = new MemoryStream())
{
      Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(qr, stream, new PngBitmapEncoder());
 
      //RadFixedDocument
       document.InsertImage(stream, area);
}

 

I have the following error on this line: Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(qr, stream, new PngBitmapEncoder());

Parameter value must be greater then 0. ParameterName: pixelWidth
 
   in System.Windows.Media.Imaging.RenderTargetBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat)
   in Telerik.Windows.Media.Imaging.ExportHelper.GetBitmapSource(FrameworkElement element, Double dpiX, Double dpiY)
   in Telerik.Windows.Media.Imaging.ExportHelper.GetElementImage(FrameworkElement element)
   in Telerik.Windows.Media.Imaging.ImageExporter.Export(FrameworkElement element, Stream stream, BitmapEncoder encoder)
   in Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(FrameworkElement element, Stream stream, BitmapEncoder encoder)
   in MileClient.DocumentUserControl.ExportAndViewDocumentWithImageStamp(DocumentHistoryEntity documentHistory) in D:\MyClient\Source\Gui\Wpf\UserControls\DocumentUserControl.xaml.cs:riga 714
   in MileClient.DocumentUserControl.OpenDocumentHistoryButton_Click(Object sender, RoutedEventArgs e) in D:\MyClient\Source\Gui\Wpf\UserControls\DocumentUserControl.xaml.cs:riga 614
   in System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   in System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   in System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   in System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   in System.Windows.Controls.Primitives.ButtonBase.OnClick()
   in System.Windows.Controls.Button.OnClick()
   in System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   in System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   in System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   in System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   in System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   in System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   in System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   in System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   in System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   in System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   in System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   in System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   in System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   in System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   in System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   in System.Windows.Input.InputManager.ProcessStagingArea()
   in System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   in System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   in System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   in System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   in System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   in MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   in MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   in System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   in System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Lance | Senior Manager Technical Support
Telerik team
 answered on 05 Apr 2019
2 answers
1.2K+ views

Hello

I use the GridView and I want to know how to select no cell when SelectionUnit = "FullRow" is set. Currently the row is selected, but also the clicked cell (is shown as selected). I'm using the Material-Theme and Version 19.1.220.

Thanks.

Alex
Top achievements
Rank 1
 answered on 05 Apr 2019
1 answer
421 views

Hi, I created a Validation Class and I using with a RadComboBox that is populated by MySQL but the validation doesn't work. When I populate by RadComboBoxItem it's work.

Validation.cs:

namespace Drex.Classes
{
    public class Validations : ViewModelBase, IDataErrorInfo
    {
        private string _NumeroProcesso;
        private DateTime? _Data;
        private Double? _AreaTerreno;
        private string _Parametro;
        private string _Interessado;
        private string _Endereco;
        private string _AutorProjeto;
        private string _ARTAutorProjeto;
        private string _ResponsavelExecucao;
        private string _ARTResponsavelExecucao;
        private string _ResponsavelAnalise;

        public string NumeroProcesso
        {
            get { return _NumeroProcesso; }
            set { _NumeroProcesso = value; this.OnPropertyChanged("NumeroProcesso"); }
        }

        public DateTime? Data
        {
            get { return _Data; }
            set { _Data = value; this.OnPropertyChanged("Data"); }
        }

        public Double? AreaTerreno
        {
            get { return _AreaTerreno; }
            set { _AreaTerreno = value; this.OnPropertyChanged("AreaTerreno"); }
        }

        public string Parametro
        {
            get { return _Parametro; }
            set { _Parametro = value; this.OnPropertyChanged("Parametro"); }
        }

        public string Interessado
        {
            get { return _Interessado; }
            set { _Interessado = value; this.OnPropertyChanged("Interessado"); }
        }

        public string Endereco
        {
            get { return _Endereco; }
            set { _Endereco = value; this.OnPropertyChanged("Endereco"); }
        }

        public string AutorProjeto
        {
            get { return _AutorProjeto; }
            set { _AutorProjeto = value; this.OnPropertyChanged("AutorProjeto"); }
        }

        public string ARTAutorProjeto
        {
            get { return _ARTAutorProjeto; }
            set { _ARTAutorProjeto = value; this.OnPropertyChanged("ARTAutorProjeto"); }
        }

        public string ResponsavelExecucao
        {
            get { return _ResponsavelExecucao; }
            set { _ResponsavelExecucao = value; this.OnPropertyChanged("ResponsavelExecucao"); }
        }

        public string ARTResponsavelExecucao
        {
            get { return _ARTResponsavelExecucao; }
            set { _ARTResponsavelExecucao = value; this.OnPropertyChanged("ARTResponsavelExecucao"); }
        }

        public string ResponsavelAnalise
        {
            get { return _ResponsavelAnalise; }
            set { _ResponsavelAnalise = value; this.OnPropertyChanged("ResponsavelAnalise"); }
        }


        public Validations(Processo_Type items, bool _selected)
        {
            if (_selected)
            {
                NumeroProcesso = items.Numero;
                Data = items.Data;
                AreaTerreno = 10.2;
                Parametro = "";
                Interessado = items.Interessado;
                Endereco = items.Endereco;
                AutorProjeto = items.AutorProjeto;
                ARTAutorProjeto = items.ARTAutorProjeto;
                ResponsavelExecucao = items.ResponsavelExecucao;
                ARTResponsavelExecucao = items.ARTResponsavelExecucao;
                ResponsavelAnalise = items.ResponsavelAnalise;
            }
            else
            {
                NumeroProcesso = null;
                Data = null;
                AreaTerreno = 0.0;
                Parametro = null;
                Interessado = null;
                Endereco = null;
                AutorProjeto = null;
                ARTAutorProjeto = null;
                ResponsavelExecucao = null;
                ARTResponsavelExecucao = null;
                ResponsavelAnalise = null;
            }
        }

        public string this[string columnName]
        {
            get
            {
                Debug.WriteLine(columnName);
                if ("NumeroProcesso" == columnName)
                {
                    if (String.IsNullOrEmpty(NumeroProcesso))
                    {
                        return "Favor informar o número do processo";
                    }
                }

                if ("Data" == columnName)
                {
                    if (!_Data.HasValue)
                    {
                        return "Favor informar a data do processo";
                    }
                }

                if ("AreaTerreno" == columnName)
                {
                    if ((AreaTerreno == 0.0) || (!AreaTerreno.HasValue))
                    {
                        return "Favor informar o total da área do terreno";
                    }
                }

                if ("Parametro" == columnName)
                {
                    if (String.IsNullOrEmpty(Parametro))
                    {
                        return "Favor informar um parâmetro";
                    }
                }

                if ("Interessado" == columnName)
                {
                    if (String.IsNullOrEmpty(Interessado))
                    {
                        return "Favor informar o nome do interessado";
                    }
                }

                if ("Endereco" == columnName)
                {
                    if (String.IsNullOrEmpty(Endereco))
                    {
                        return "Favor informar o endereço do projeto";
                    }
                }

                if ("AutorProjeto" == columnName)
                {
                    if (String.IsNullOrEmpty(AutorProjeto))
                    {
                        return "Favor informar o nome do autor do projeto";
                    }
                }

                if ("ARTAutorProjeto" == columnName)
                {
                    if (String.IsNullOrEmpty(ARTAutorProjeto))
                    {
                        return "Favor informar a ART do autor do projeto";
                    }
                }

                if ("ResponsavelAnalise" == columnName)
                {
                    if (String.IsNullOrEmpty(ResponsavelAnalise))
                    {
                        return "Favor informar o nome do responsável pela análise";
                    }
                }

                return "";
            }
        }

        public string Error
        {
            get { throw new NotImplementedException(); }
        }
    }

}

 

 

.xaml:

                <telerik:RadComboBox Text="{Binding Parametro, Mode=TwoWay, ValidatesOnDataErrors=True, NotifyOnValidationError=True, ValidatesOnExceptions=True}"
                                     x:Name="Parametro"
                                     VerticalAlignment="Center"
                                     HorizontalAlignment="Stretch" 
                                     HorizontalContentAlignment="Left"
                                     EmptyText="[selecione um parâmetro]" 
                                     IsEditable="True" 
                                     IsReadOnly="True"
                                     DataContext="{StaticResource Parametro_Call}" 
                                     ItemsSource="{Binding Parametros}"
                                     DisplayMemberPath="Parametro" 
                                     SelectedValuePath="IDParametro"/>

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 05 Apr 2019
5 answers
105 views
I use RadCartesianChart3d to display a surface map with a lot of points.  Hundreds of thousands.  And it displays well but as you might imagine, it takes a long time for me to generate all of those points.   So I had an idea (what turned out to be a bad idea) that I would make things more efficient by changing my pixel type -- my class to which the chart binds --  from a class into a struct.  

Obviously, that failed.  The RadCartesianChart3D threw an exception with the text "Dynamic getter is not supported for value types.".  

And I get this.  Makes sense given how the chart works.  But it leads me to wonder:  Is there an alternative approach in Telerik world that would give me the efficiency I'm looking for?

It just seems that if there were some simpler version of the chart that could work with some a stock struct type with X,Y,Z double values, it would have to be a lot faster.  Not forcing the GC to track 200,000 garbage-collectible references seems like it would have to be a boost, no?

So is there such an alternative?  And if not, is this something that might even be on Telerik's radar for the future?

Or is my thinking wrong here and would such a chart *not* give m the performance improvement I expect (and if so, why not?)

Thanks,
Martin Ivanov
Telerik team
 answered on 05 Apr 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?