Telerik Forums
UI for WPF Forum
1 answer
286 views
Hi how to get corner radius ie, rounded corner combobox in WPF, and also i dont need ro show the scrollbar while it showing items in the combobox?
thanks
Masha
Telerik team
 answered on 21 Dec 2013
2 answers
524 views
I want to save the image in the Image Editor to byte[]. How to achieve this? Is there any example available?

Thanks in Advance,

SamJayander.
samjayander
Top achievements
Rank 1
 answered on 21 Dec 2013
5 answers
194 views
Hi,

I'm using CartesianMarkedZoneAnnotation on RadCartesianChart with a date/time x-axis. When zooming and/or panning the annotation starts moving to a wrong position. The control is inside a tab. Switching between tabs refreshes the control and the annotation returns to the correct position. Bug? Am I missing something?

Markus
Petar Marchev
Telerik team
 answered on 20 Dec 2013
1 answer
108 views
Hi

I want to customize the popup menu of a radrichtextbox with new sub item

I use the ContextMenuContentBuilder like this :


    internal class CustomMenuBuilder : ContextMenuContentBuilder, IDisposable
    {
        private RadMenuItem InsertHyperLink;
        private MyCustomRichTextBox richTextBox;
 
        public CustomMenuBuilder(MyCustomRichTextBox  richTextBox)
            : base(richTextBox)
        {
            this.richTextBox = richTextBox;
 
            InsertHyperLink= new RadMenuItem
            {
                Header = CultureTasks.GetUIString("Infologic.Composite.Views.ILEditeur.CustomMenuBuilder.Message01", "Insert hyperlink"),
                Icon = new Image()
                    {
                        Source = new BitmapImage(new Uri("pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/Inserthyperlink.png"))
                    }
            };
            InsertHyperLink.Tag = richTextBox;
            InsertHyperLink.Click += InsertHyperlink_Click;
        }
 
        void InsertHyperlink_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            this.richTextBox.MyInsertHyperlink();
        }
 
        protected override ContextMenuGroup CreateFieldCommands()
        {
            return null;
        }
 
        protected override ContextMenuGroup CreateHyperlinkCommands(bool forExistingHyperlink)
        {
            return null;
        }
 
        protected override ContextMenuGroup CreateTextEditCommands()
        {
            var commands = base.CreateTextEditCommands();
            commands.Add(InsertHyperLink);          // OK
            //commands.Insert(0, InsertHyperLink);  // KO -> stack overflow
            return commands;
        }
 
        public void Dispose()
        {
            InsertHyperLink.Click -= InsertHyperlink_Click;
 
            InsertHyperLink= null;
 
            richTextBox = null;
        }
    }


Then i use this custom builder like this when i instanciate my richtextbox :

var richTextControl = new MyCustomRichTextBox
                          {
                              Name = string.Format("rtb{0}", increment),
                              AcceptsTab = false,
                              LayoutMode = DocumentLayoutMode.Flow,
                              IsSelectionMiniToolBarEnabled = false,
                              DocumentInheritsDefaultStyleSettings = true,
                              FontFamily = fontFamily,
                              ShowMergeFieldsHighlight = true,
                              FontSize = fontSize,
                              HorizontalScrollBarVisibility = ScrollBarVisibility.Auto
                          };
 
var builder = new CustomMenuBuilder(richTextControl);
 
richTextControl.ContextMenu = new Telerik.Windows.Controls.RichTextBoxUI.ContextMenu();
 
((Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)richTextControl.ContextMenu).ContentBuilder = builder;



If i use ContextMenuGroup.Add , it's ok, but i want my item to be the first of the popup menu.

If i use ContextMenuGroup.Insert , i got a stack-overflow


Is it a bug or is it me who don't use the component properly ?

Petya
Telerik team
 answered on 20 Dec 2013
3 answers
132 views
We are using RadControls for WPF version 2013.2.611.40

A bug was reported to us where the original selected text in a RadRichTextBox was not displayed in our custom Insert Hyperlink dialog.  This is because the RadRichTextBox does not pass along the selected text to the IInsertHyperlinkDialog.ShowDialog() method if the text includes trailing newline characters.

Expected behavior (for example, Microsoft Outlook):

Open a blank new email, type a word, press enter, and select the whole line containing the word.  The editor will select the word, along with the trailing newline character.  When you click Insert -> Hyperlink, the trailing newline character is deselected, so that it will not be included in the created hyperlink.  The "Text to display" field will then contain the word you typed.

Actual behavior (In the WPF RadRichTextBox)

Open a blank document, type a word, press enter, and select the whole line containing the word.  The editor will select the word, along with the trailing newline character.  When you execute the InsertHyperlinkCommand, IInsertHyperlinkDialog.ShowDialog() is called on our implementation of IInsertHyperlinkDialog as expected.  However, the newline character remains selected, and as a result the passed "text" string is null.  The resulting behavior is that we do not display anything in the "Text to display" field of the Insert Hyperlink dialog.

Is this a known issue?

Thanks,
Evan



   
Vasil
Telerik team
 answered on 20 Dec 2013
2 answers
246 views
Hello Telerik,

regarding this thread, I'd like to know if this issue still is not fixed? We really try to make it work, but the RadWindow doesn't resize, when its content size is changed.

Is there something required like setting the MinHeight?

If it works properly, I'd really like to know which properties need to be set to certain values, because I can't figure it out from the documentation.

EDIT: currently we achieve the behaviour we'd like to have through hacking the contents ActualHeight into the RadWindows Height property (content's OnSizeChanged event). We prevent layout cycles through a couple of if-statements, but we'd really like to get rid of this.
tung ngie
Top achievements
Rank 1
 answered on 20 Dec 2013
2 answers
209 views
Hi,

I have had this problem a couple of times now and i dont understand why it happens. 

Every time i try to use a property on for example an AreaSeries, the compiler tells me that this property does not exist in the telerik namespace "http://schemas.telerik.com/2008/xaml/presentation" even though the intellisense suggest the property. 

See attached image.

I have the following code for the graph:
<telerik:RadCartesianChart Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Margin="0,0,0,3" x:Name="lineSeries" ClipToBounds="False">
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis IsInverse="True" Name="verticalAxis" Title="Depth(µm)"/>
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:LinearAxis Name="horizontalAxis" Title="Concentration(µmol/l)"/>
            </telerik:RadCartesianChart.HorizontalAxis>
             
            <telerik:ScatterPointSeries x:Name="pointSeries" XValueBinding="XValue" YValueBinding="YValue" ItemsSource="{Binding}">
                <telerik:ScatterPointSeries.PointTemplate>
                    <DataTemplate>
                        <Ellipse Width="17" Height="17" Fill="Blue"/>
                    </DataTemplate>
                </telerik:ScatterPointSeries.PointTemplate>
            </telerik:ScatterPointSeries>
 
            <telerik:ScatterLineSeries ItemsSource="{Binding}" StrokeThickness="1.5" x:Name="serie" Stroke="Red" XValueBinding="XValue" YValueBinding="YValue">
            </telerik:ScatterLineSeries>
 
            <telerik:AreaSeries StrokeThickness="2" Fill="Gray">
                <telerik:AreaSeries.DataPoints>
                    <telerik:CategoricalDataPoint Value="20"/>
                    <telerik:CategoricalDataPoint Value="40"/>
                    <telerik:CategoricalDataPoint Value="35"/>
                    <telerik:CategoricalDataPoint Value="40"/>
                    <telerik:CategoricalDataPoint Value="30"/>
                    <telerik:CategoricalDataPoint Value="50"/>
                </telerik:AreaSeries.DataPoints>
            </telerik:AreaSeries>
 
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both"/>
            </telerik:RadCartesianChart.Behaviors>
 
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid Name="chartGrid" MajorLinesVisibility="XY" MajorXLineDashArray="5, 5" MajorYLineDashArray="5, 5">
                    <telerik:CartesianChartGrid.MajorXLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Shape.Stroke" Value="Gray" />
                        </Style>
                    </telerik:CartesianChartGrid.MajorXLineStyle>
                    <telerik:CartesianChartGrid.MajorYLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Shape.Stroke" Value="Gray" />
                        </Style>
                    </telerik:CartesianChartGrid.MajorYLineStyle>
                </telerik:CartesianChartGrid>
            </telerik:RadCartesianChart.Grid>
        </telerik:RadCartesianChart>


I must be doing something wrong here i just cant see what it is :)

Best regards,
Jeppe
Unisense
Top achievements
Rank 1
 answered on 20 Dec 2013
1 answer
135 views
Hi

Is it possible to have a Barcode column in a gridview?  If so do you have an example?

Regards,
Joe
Vanya Pavlova
Telerik team
 answered on 20 Dec 2013
7 answers
246 views
Hi,

I'm having trouble with the scroll and zoom feature on the RadChart. I have a 2D Range bar set up to mimic a Gantt style chart where certain products are on sale over different weeks and the chart allows users to keep track of the movement.

I have the chart set up to use the High/Low co-ordinates for start week and end week respectively, with the Y axis labels using the Low value while the X axis uses the product name as a label instead of the High value.

The trouble I'm having is when i add the scroll bar to the chart as per the example in the demos, it only works for the Y axis and not the X. The actual scroll bar does appear and the zoom buttons do change the dimensions of the scroller, and the drag select option also seems to work properly, but the actual chart remains unchanged for some reason...

As you can see, the scroll bar on the left is set to a high level of zoom, yet the entire chart is still displayed and no zooming actually happens.



The XAML that I use looks like this:

<telerik:ChartArea Grid.Row="0" x:Name="ChartArea" NoDataString="" LabelFormatBehavior="None" ItemClick="ChartArea_ItemClick"
                                            PaletteBrushesRepeat="False" EnableAnimations="False" >
                            <telerik:ChartArea.ZoomScrollSettingsX>
                                <telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom" MinZoomRange="0.005"/>
                            </telerik:ChartArea.ZoomScrollSettingsX>
                            <telerik:ChartArea.PaletteBrushes>
                                <SolidColorBrush Color="Orange"/>
                            </telerik:ChartArea.PaletteBrushes>
                            <telerik:ChartArea.AxisY>
                                <telerik:AxisY Title="Week" ExtendDirection="Up" DefaultLabelFormat="W20#VAL" AutoRange="True">
                                    <telerik:AxisY.AxisStyles>
                                        <telerik:AxisStyles TitleStyle="{StaticResource CustomAxisTitleStyle}" />
                                    </telerik:AxisY.AxisStyles>
                                </telerik:AxisY>
                            </telerik:ChartArea.AxisY>
                            <telerik:ChartArea.AxisX>
                                <telerik:AxisX LayoutMode="Between" />
                            </telerik:ChartArea.AxisX>
                        </telerik:ChartArea>


The code for the zoom is the same as in the demo and works fine if I set it for the Y axis but for some reason, not the X...

public void ZoomIn(object parameter)
        {
            this.ChartArea.ZoomScrollSettingsX.SuspendNotifications();
 
            double zoomCenter = this.ChartArea.ZoomScrollSettingsX.RangeStart + (this.ChartArea.ZoomScrollSettingsX.Range / 2);
            double newRange = Math.Max(this.ChartArea.ZoomScrollSettingsX.MinZoomRange, this.ChartArea.ZoomScrollSettingsX.Range) / 2;
            this.ChartArea.ZoomScrollSettingsX.RangeStart = Math.Max(0, zoomCenter - (newRange / 2));
            this.ChartArea.ZoomScrollSettingsX.RangeEnd = Math.Min(1, zoomCenter + (newRange / 2));
 
            this.ChartArea.ZoomScrollSettingsX.ResumeNotifications();
 
            ((Telerik.Windows.Controls.DelegateCommand)_zoomInCommand).InvalidateCanExecute();
            ((Telerik.Windows.Controls.DelegateCommand)_zoomOutCommand).InvalidateCanExecute();
        }


What am I doing wrong?

Regards,
Nemanja
Peshito
Telerik team
 answered on 20 Dec 2013
5 answers
349 views
Hi
I’m working on a project to create pivot table dynamically.

The goal is to build a pivot table based on 2 Collections, which is generated by reading some file. The 1st collection defines the column names and type (e.g. double, string, etc.) of the data. The 2nd one contains a list of strings, which represents all the data, so the type of the data is only known at run time.

I'd like to know is it possible to bind the above data structure to the RadPivotGrid. 

I've tried to set a Collection of dynamic objects to the ItemsSource by using LocalDataSourceProvider, but it seems the data are not shown in the pivot table.

An example of the dynamic object.
dynamic dObject1 = new ExpandoObject();
dObject1.Name = "Name1";
dObject1.Value = 1;

Thanks in advance.

Regards,
Gong
Kalin
Telerik team
 answered on 20 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?