Telerik Forums
UI for WPF Forum
1 answer
135 views
We are using your trial version .Now we face some problems for radrichtextbox
1. We save document by following code
   public void ExportContent(string defaultExtension, string filter,IDocumentFormatProvider formatProvider)
        {
            var saveFileDialog = new SaveFileDialog
            {
                DefaultExt = defaultExtension,
                Filter = filter
            };        
            saveFileDialog.FileName = wordfilepath;
                using (var outputStream = saveFileDialog.OpenFile())
                {
                    formatProvider.Export(radRichTextBox1.Document, outputStream);
                }           
        }
2 . Now when we insert picture using teleriks insert picture method .Picture is inserted and file is saved by above method.Then on another form we cannot display this image on richtextbox .So I added code to picture command as follows
string fieldName = ((RadRibbonButton)e.Source).Text;

            if (fieldName.ToUpper() == "PICTURE")
            {
                MergeField mf = new MergeField();
                mf.PropertyPath = fieldName;
                IncludePictureField picField = new IncludePictureField();
                picField.SetPropertyValue(IncludePictureField.ImageUriProperty, mf);
                this.radRichTextBox1.InsertField(picField);
            }
            else
            {
                radRichTextBox1.InsertField(new MergeField() { PropertyPath = fieldName });
            }
this insert image and also label PICTURE as merged field but on form where this rtf file displayed in richtextbox it shows "Cannot display image"
3. Please tell us teleriks proper method to insert image and display on richtextbox (Field merge method).We are new teleriks method.
4. Also When we create Header and footer in Teleriks editor and save file in rtf. When this rtf file loaded again it doesn't shows header and footer .Please tell me reason behind this.



Missing User
 answered on 23 Jan 2014
1 answer
165 views
I looking for an event to handle before RadDataForm.CurrentItemChanged happens. 

At CurrentItemChanged, the CurrentItem is already the new item, but I need to carry out some operations on the old item.
So I'm looking for something like "BeforeCurrentItemChanged" or "PreviewCurrentItemChanged" or "CurrentItemChanging" etc.
Vera
Telerik team
 answered on 23 Jan 2014
5 answers
189 views
Hi,

I am trying to migrate a coded UI test to validate the contents of a RadGridView table which has replaced a WPF GridView control.  Previously the test retrieved the contents of the table something like;

 
 var grid = TableGrid;
 List<string> headers = new List<string>(from h in grid.ColumnHeaders.AsQueryable() select h.FriendlyName);
 int idColumn = headers.FindIndex(x => x == "Id") + 1;
 int productTypeColumn = headers.FindIndex(x => x == "Product Type") + 1;
 int titleColumn = headers.FindIndex(x => x == "Title") + 1;
 Collection<Collection<string>> contents = new Collection<Collection<string>>();
 foreach(var row in grid.Rows)
 {
     var cells = row.GetChildren();
     contents.Add(new Collection<string>() {
         cells[idColumn].FriendlyName, cells[productTypeColumn].FriendlyName, cells[titleColumn].FriendlyName });
 }
 return contents;

 
With RadGridView I can access the column headers and find out the number of rows, however there are no rows held against the table in the Rows property.  If I try to add a validation against a single cell in the coded UI test builder they appear to be under a separate hierarchy (UIPART_GridViewVirtualCustom).  

I can't create individual validations against each cell using the coded UI test builder as the volume of cells to validate makes that unwieldy so I need to be able to validate them programatically which we were able to do with the standard WPF GridView control through the Rows property.

Can anyone provide any suggestions as how I can programatically check the RadGridView contents using codedUI.

Thanks in advance
Ivan Ivanov
Telerik team
 answered on 23 Jan 2014
2 answers
207 views
Hello;

I am working on a project with the following requirements :
- I have a dashboard with a set of tile view items in different size (large, small, medium).
- Each tile item size has its content.
- In the normal (medium) view, I need to add a button "properties". When the user clicks on, a child window will be opened in order to set the properties of the tile view item and filter the information to be displayed in the different views.

I am stuck in the third part. As the tile view item is a user control, I found a solution on internet based on behavior which allows me to open the child window, however, i cannot implement the close & OK buttons using MVVM.

I need your support on this point.
Thanks for your help.

Best regards

Sam
Sam
Top achievements
Rank 1
 answered on 23 Jan 2014
1 answer
168 views
In the attached screenshot, I have a  single 3D bar series.  I've set the labels at a 30 degree angle so they won'd overlap. However, they now overlap with the axis title. Is there a way for me to specify a margin for the title, or is there some other mechanism I can use to prevent this overlap?  Thanks - Mitch
Evgenia
Telerik team
 answered on 23 Jan 2014
1 answer
96 views
Hi

Using the GraphSource for binding with Nodes and Links is it possible to style nodes within code and not using StyleSelectors? E.g. change a node to a elipse or triangle

Thanks
Pavel R. Pavlov
Telerik team
 answered on 23 Jan 2014
6 answers
315 views

I

 have a problem with CartesianCustomAnnotation. there is a RadCartesianChart with zoom ability,

<telerik:RadCartesianChart x:Name="chart"   Zoom="{Binding Zoom, Mode=TwoWay}" >
         <telerik:RadCartesianChart.Behaviors >
                       <telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Horizontal" MouseWheelMode="Zoom" />
       </telerik:RadCartesianChart.Behaviors>
<!--some codes-->
</<telerik:RadCartesianChart >
then I programmatically added a triangle as CartesianCustomAnnotation
System.Windows.Shapes.Polygon triangle = new Polygon();
//some codes
 chart.Annotations.Add(new Telerik.Windows.Controls.ChartView.CartesianCustomAnnotation
            {  HorizontalValue = somePointX,//DateTime
                VerticalValue=.somePointY,
                Content =  triangle
            } );
As the below figure shows, the problem is  when I changed the chart's zoom, the shape size does not change, actually I want the vertexes of triangles sticks to their initial coordinates, and triangle resize itself with changing zoom.

Peshito
Telerik team
 answered on 23 Jan 2014
5 answers
313 views
I'm trying to dynamically adjust the tick marks and labels on a RadCartesianChart using MajorTickInterval and LabelInterval when zooming to maintain an acceptable look. However, the chart does not maintain the specified MajorTickInterval when zooming, and I haven't been able to figure out the specifics of the behavior to adjust accordingly.

Here's a simple example to illustrate.

XAML:
<Window x:Class="ZoomMajorTickInterval.MainWindow"
        Title="MainWindow" Height="350" Width="1280">
    <Grid>
        <telerik:RadCartesianChart x:Name="Chart">
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis LabelFitMode="Rotate" />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both" />
            </telerik:RadCartesianChart.Behaviors>
            <telerik:RadCartesianChart.Series>
                <telerik:LineSeries ItemsSource="{Binding MyData}" CategoryBinding="PeriodText" ValueBinding="DataValue" />
            </telerik:RadCartesianChart.Series>
        </telerik:RadCartesianChart>
    </Grid>
</Window>

Code-behind:
using System;
using System.Windows;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls.ChartView;
namespace ZoomMajorTickInterval
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            Random r = new Random();
            MyData = new ObservableCollection<DataPoint>();
            for (int ctr = 0; ctr < 500; ctr++)
                MyData.Add(new DataPoint() { PeriodText = "Q" + ctr.ToString(), DataValue = r.Next(1000) });
            DataContext = this;
            CategoricalAxis axis = Chart.HorizontalAxis as CategoricalAxis;
            axis.MajorTickInterval = 5;
            Chart.HorizontalAxis.LabelInterval = 2;
        }
        public ObservableCollection<DataPoint> MyData { get; set; }
    }
    public class DataPoint
    {
        public string PeriodText {get; set;}
        public int DataValue { get; set; }
    }
}

Run the example and notice that initially it correctly renders major ticks every 5 data points, and labels every 2 major ticks, just as specified in the code. This displays 50 labels. Now move the max zoom slider on the horizontal axis back to about the 2/3 mark and the axis shifts from using 5 points between major ticks to 2. The labels continue to show every 2 major ticks, so now it is displaying 81 labels, which is much more crowded than desired (even more-so in my real application).

Even more problematically, the value of MajorTickInterval remains 5 even though the display has changed, so I have no way to re-calculate the LabelInterval appropriately to maintain the number of labels I want.

Is this a bug, or is there an algorithm at work here? If the latter, how can I determine what the interval actually is to adjust the labels correctly?

I'm using the 2013 1204 build.

Thanks,
Louis


										
Pavel R. Pavlov
Telerik team
 answered on 23 Jan 2014
1 answer
300 views
Hi,

I have a little problem

My gridview bind to a Observable collection and work well.
I would add a column wich contains a specific usercontrol and the binding is a List<MyViewModel> but it doesn't.
The datacontext of my control is ever null.

the XAML :
<telerik:RadGridView Name="RadGridView" Grid.Row="1" ItemsSource="{Binding Path=Documents}" DataLoadMode="Asynchronous" AutoGenerateColumns="False" SelectionMode="Single" CanUserDeleteRows="False" CanUserInsertRows="False">
<telerik:RadGridView.Columns>
...
<telerik:GridViewDataColumn IsReadOnly="True" Header="Fichier(s) joint(s)" DataMemberBinding="{Binding Files}" >
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<control:UserControl1 DataContext="{Binding Files}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
...
</telerik:RadGridView>
Dimitrina
Telerik team
 answered on 23 Jan 2014
2 answers
96 views
I am adding columns to a grid programmatically as the number of columns can vary.  Additionally I want to sum the column values in the column footer.  The following code is used to achieve this;

Private Sub AddContractYearColumns()
    Dim sPeriod As String = String.Empty
    Dim iIndex As Integer = 0
 
    Try
        Dim Years = From Yrs In gdcRAD.vw_ProjectYears Select Yrs.Year
 
        For Each Yr As String In Years
            If Yr.ToInteger >= Year(Date.Today) Then
                iIndex += 1
                sPeriod = "Period" & iIndex.ToString("00")
 
                Dim column As New GridViewDataColumn()
 
                With column
                    .Header = Yr
                    .UniqueName = Yr
                    .DataMemberBinding = New Binding(sPeriod)
                    .DataFormatString = "0.00"
                    .TextAlignment = TextAlignment.Right
                End With
 
                gvContractYrs.Columns.Add(column)
 
                Dim f As New Telerik.Windows.Data.SumFunction
                f.SourceField = sPeriod
                gvContractYrs.Columns(Yr).AggregateFunctions.Add(f)
            End If
        Next
    Catch ex As Exception
        Throw New RadException("Add Contract Year Columns", ex.Message, ex.InnerException)
    End Try
End Sub

This creates columns with headings such as "2014", "2015", etc that are bound to "Period01", "Period02", etc.

The following code is then used to to obtain and bind the data to the grid;

Private Sub DisplayAvailableEquipYrs()
    Try
        Dim EquipList = (From Equipment In gdcRAD.usp_YearsAvailable(Date.Today, False, False) Select Equipment).ToList
        gvContractYrs.ItemsSource = EquipList
 
    Catch ex As Exception
        Throw New RadException("Display Available Equipment Years", ex.Message, ex.InnerException)
    End Try
End Sub

The EquipList is populated correctly with a nullable Double data type being returned for "Period01", "Period02", etc however I get the error "No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments." when I attempt to bind the EquipList object to the ItemsSource.

Could the nullable data type be causing the problem?
Yoan
Telerik team
 answered on 23 Jan 2014
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?