Telerik Forums
UI for WPF Forum
1 answer
186 views

I have this chart:

<telerik:RadCartesianChart Name="myChart">
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LogarithmicAxis LogarithmBase="2"
                         Minimum="125" Maximum="8000"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="10" Minimum="-130"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:ScatterLineSeries>
            <telerik:ScatterLineSeries.DataPoints>
                <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
            </telerik:ScatterLineSeries.DataPoints>
        </telerik:ScatterLineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

And in my code i have timer that receive data every second:

private Random random = null;

Create timer:

random = new Random();
    System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
    dispatcherTimer.Tick += dispatcherTimer_Tick;
    dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
    dispatcherTimer.Start();

Timer tick:

private void dispatcherTimer_Tick(object sender, EventArgs e)
{
    int val = random.Next(0, 100);
    line.DataPoints.Add(new CategoricalDataPoint() { Value = val });
}

I all i want to to (i am totally new with WPF) is to replace my hard coded values in my XAML in the real time data that the timer received (the 'val' variable).

My timer is define only in the code and not in XAML.

How can i do that ?

I have this chart:

<telerik:RadCartesianChart Name="myChart"> 

 
 
ffffff
 
 
<telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LogarithmicAxis LogarithmBase="2"
                         Minimum="125" Maximum="8000"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="10" Minimum="-130"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:ScatterLineSeries>
            <telerik:ScatterLineSeries.DataPoints>
                <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
            </telerik:ScatterLineSeries.DataPoints>
        </telerik:ScatterLineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

And in my code i have timer that receive data every second:

I have this chart:

<telerik:RadCartesianChart Name="myChart">
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LogarithmicAxis LogarithmBase="2"
                         Minimum="125" Maximum="8000"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="10" Minimum="-130"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:ScatterLineSeries>
            <telerik:ScatterLineSeries.DataPoints>
                <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
            </telerik:ScatterLineSeries.DataPoints>
        </telerik:ScatterLineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

And in my code i have timer that receive data every second:

I have this chart:

<telerik:RadCartesianChart Name="myChart">
    <telerik:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
    </telerik:RadCartesianChart.Grid>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:LogarithmicAxis LogarithmBase="2"
                         Minimum="125" Maximum="8000"/>
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Maximum="10" Minimum="-130"/>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:ScatterLineSeries>
            <telerik:ScatterLineSeries.DataPoints>
                <telerik:ScatterDataPoint YValue="-40" XValue="125"/>
                <telerik:ScatterDataPoint YValue="-50" XValue="250"/>
                <telerik:ScatterDataPoint YValue="-60" XValue="500"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="1000"/>
                <telerik:ScatterDataPoint YValue="-80" XValue="2000"/>
                <telerik:ScatterDataPoint YValue="-70" XValue="4000"/>
            </telerik:ScatterLineSeries.DataPoints>
        </telerik:ScatterLineSeries>
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

And in my code i have timer that receive data every second:

 
 
 
 
 
 
 
 
 
 
Text-to-speech function is limited to 100 characters
 
Petar Marchev
Telerik team
 answered on 27 May 2015
3 answers
76 views

Hello, 

Using the latest WPF controls,  I need to add inside a RadWindow, a RadTimePicker or RadDatePicker. 
When I run the application the controls are displayed correctly, but when I try to open the datepicker, I get the attached error.

I`ve added the NoXML dlls and in the App.XAML I`ve added the Windows8Touch theme for each control.
Note that, independently, all controls are working perfectly fine, but in this case I don`t understand what is the problem. Am I missing something ?
Details of the sistem : Windows 8.1 x64

Nasko
Telerik team
 answered on 26 May 2015
10 answers
409 views
Hello!
I use the following line in my code:
this.telerikChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "#VAL{N0} " + unitName + " ";



I try to format the Y axis labels in a way that it shows the actual value concatenated with a specific unit name, but the way provided by you in the tutorial give me only rounded values concatenated with the unit name - like in the image attached labelformat.png - and I get on Y axis few times 0 values, few 1 values and not the real values that I need (shown correctly but without unit in labelformatnorounding.png)

What is the correct format string if I don.t want this rounding?

Thank you!
Roxana

Martin Ivanov
Telerik team
 answered on 26 May 2015
1 answer
166 views

Hello.
Is it possible to use RadRibbonBackstageItem  with prism?
I try to use navigation but view doesn't appears.

 <telerik:RadRibbonBackstageItem Header="Info" IsDefault="True" Command="{Binding NewCommand}" CommandParameter="Info" >
               <ContentControl regions:RegionManager.RegionName="RadRibbonViewRegion" />
</telerik:RadRibbonBackstageItem>

...

 var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
regionManager.RequestNavigate("RadRibbonViewRegion", new Uri("New", UriKind.Relative));

 

 

 

Kiril Vandov
Telerik team
 answered on 26 May 2015
3 answers
183 views

Hi,

I tried to load a complex 3D project exported as KMZ from Sketchup. Nothing appears...
You have planned a complete support for Kml specifications?
If not, exists another way to show a sketchup project into a RadMap (or other control)?

thanks
marc.

Petar Mladenov
Telerik team
 answered on 26 May 2015
1 answer
154 views

Hi,

 

I'm using VS2013 with the latest version of Telerik and I have a problem in design mode. When I have multiple RadTabItem, if I click on a RadTabItem, the designer don't show the content of the RadTabItem I clicked on. It work only if it's the first one.

 

Thank's

Alain

Milena
Telerik team
 answered on 26 May 2015
3 answers
408 views
We have a RadDateTimePicker in a window.
When the window opens, we want to set focus on the RadDateTimePicker.
So we use 
         public OurWindow()
        {
            InitializeComponent();
            OurDateTimePicker.Focus();
        }
When openeing the window, we see the orange border (Office-theme) that indicates that the RadDateTimePicker has focus. When pushing the Arrow-Down-key the calendar opens. Great!
But, our customers also want the possibility to can write immediately in the box. How could we do this?
When we set focus from codebehind, the text in the box is not selected and there is no beam in the box.

We alse tried to set focus after the window was loaded and activated. 
Nasko
Telerik team
 answered on 26 May 2015
3 answers
273 views

In my application I have a datagrid and one of the column is a column with a richtextbox. There are about 30 rows in the datagrid and loading of each richtextbox take some time, so loading of 30 richtextboxes take a lot of time. 

Is there any way to improve loading speed of datagrid with richtextboxes? Maybe they can use the same background logic instead of separated for each item.

If it could help, at the same time only one richtextbox can be editable. So, by default row is read only, but user can edit only one at the same time.

 Thanks

 

Best Regards,

Grigory

Grigory
Top achievements
Rank 2
 answered on 25 May 2015
3 answers
269 views

I am using EF 6 to connect to a database in a WPF app using MVVM pattern.  I have a derived context like so:

 

public class TIMSContext : DbContext
  {
      public TIMSContext()
          : base("name=TIMSContext") { }
 
 
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          //map models...
      }
 
      public IQueryable<T> Query<T>()
      {
          return this.Set(typeof(T)).AsQueryable() as IQueryable<T>;
      }
 
  }

 

I want to use the EntityFrameworkDataSource to provide items to a RadGridView so that I don't have to write the paging/filtering code myself.  I have looked at the example, but I cannot get it to work.

 

My XAML:

<telerik:RadGridView x:Name="RadGridView1"
                               Grid.Row="0"
                               AlternateRowBackground="CornflowerBlue"
                               AlternationCount="2"
                               AutoGenerateColumns="True"
                               CanUserDeleteRows="False"
                               CanUserFreezeColumns="False"
                               CanUserInsertRows="False"
                               GroupRenderMode="Flat"
                               IsReadOnly="True"
                               ItemsSource="{Binding ShipmentData}"
                               RowIndicatorVisibility="Collapsed" />
 
          <telerik:RadDataPager Grid.Row="1"
                                DisplayMode="FirstLastPreviousNextNumeric"
                                PageSize="25"
                                Source="{Binding ShipmentData}"/>

 

Here is my Viewmodel:

public class ShipmentsViewModel :ViewModelBase
    {
        private readonly QueryableEntityCollectionView<TIMS.Data.Entities.ASN> shipments;
        private readonly TIMS.Data.TIMSContext ctx;
 
        public ShipmentsViewModel()
        {
            try
            {
                ctx = new Data.TIMSContext();
                shipments = new QueryableEntityCollectionView<Data.Entities.ASN>(ctx, "ASN");
                //Argument 1: cannot convert from 'TIMS.Data.TIMSContext' to 'System.Data.Objects.ObjectContext'
 
 
                //Also tried this which I saw on some forums...
                //shipments = new QueryableEntityCollectionView<Data.Entities.ASN>( ((IObjectContextAdapter)ctx).ObjectContext, "ASN");
                //Argument 1: cannot convert from 'System.Data.Entity.Core.Objects.ObjectContext' to 'System.Data.Objects.ObjectContext'
            
            }
            catch (Exception)
            {
            }
        }
 
        #region Properties
 
        public Object ShipmentData
        {
            get
            {
                return shipments;
            }
        }
         
        #endregion
}

Dimitrina
Telerik team
 answered on 25 May 2015
1 answer
239 views

Hallo,

 

I'd like to ask about my problem. I have app where i'm working with tabControl and RadDiagram. First RadDiagram is created in  xaml code and it's loaded manualy with some logic from the xml file. DragDrop logic is based on your DragDrop tutorial and it's working fine. But when i try create diagram manualy behind the code with my own method which is defining the most important things in diagram i don't know how to make it works with my DragDropBehavior Class.

How could i define dragDrop:DragDropBehaviorRadDiagram.IsEnabled="True" behind code when i'm create new diagram?

 

thank you for your time and advices

 

Grettings 

Jakub Rautner

private RadDiagram CreateNewDiagram()
       {
           RadDiagram dgrm = new RadDiagram();
 
          // Events handlers
           dgrm.ShapeDoubleClicked += new EventHandler<ShapeRoutedEventArgs>(diagram_ShapeDoubleClicked);
           dgrm.MouseDoubleClick += new MouseButtonEventHandler(diagram_MouseDoubleClick);
           dgrm.SelectionChanged += new SelectionChangedEventHandler(diagram_SelectionChanged);
           dgrm.ZoomChanged += new EventHandler<RadRoutedPropertyChangedEventArgs<double>>(diagram_ZoomChanged);
 
 
           DragDropManager.AddDropHandler(dgrm, OnDrop);
 
           dgrm.Style = this.Resources["diagramStyle"] as Style;
           dgrm.ShapeStyleSelector = xGrid.Resources["CustomShapeStyleSelector"] as NodeStyleSelector;
           dgrm.ConnectionStyleSelector = xGrid.Resources["CustomConnectionStyleSelector"] as LinkStyleSelector;
 
           dgrm.LayoutAsync(LayoutType.Tree, TreeSettings);
 
           dgrm.IsDraggingEnabled = true;
           dgrm.AllowDrop = true;
 
           return dgrm;
       }

 

Here' s definition RadDiagram in xaml file:  dragDrop is namespace where i have created DragDropBehavior logic for TreeView and RadDiagram 

<telerik:RadDiagram x:Name="diagram" Grid.Row="0"
  ShapeStyleSelector="{StaticResource CustomShapeStyleSelector}"
  ConnectionStyleSelector="{StaticResource CustomConnectionStyleSelector}"
  Style="{StaticResource diagramStyle}"
  ZoomChanged="diagram_ZoomChanged"                                                    IsZoomEnabled="True"                                                      MouseDoubleClick="diagram_MouseDoubleClick"                                                    AllowDrop="True"                                                    dragDrop:DragDropBehaviorRadDiagram.IsEnabled="True"                                                    ShapeDoubleClicked="diagram_ShapeDoubleClicked"                                                    SelectionChanged="diagram_SelectionChanged">                                    <primitives:ItemInformationAdorner.AdditionalContent>                                        <telerik:SettingsPane x:Name="xSettingsPane" Diagram="{Binding ElementName=diagram}">                                        </telerik:SettingsPane>                                    </primitives:ItemInformationAdorner.AdditionalContent>                                </telerik:RadDiagram>

 

Petar Mladenov
Telerik team
 answered on 25 May 2015
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?