Telerik Forums
UI for WPF Forum
5 answers
1.3K+ views
I need to customize the labels on the X axis of a cartesian chart.  The date/times are not uniform across the X axis (see attached screen shot) but we'd like to see the labels/tics at regular intervals. 

For example, the attached chart starts a 5/19/2013 7:00:21 and we'd like to have a tick and label show as 5/19/2013 (midnight) even though there is not a data point at that time.  Then we'd like to have a label and tickmark at midnight each following day. So in this case, we'd like to see 5/19/2013, 5/20/2013, and 5/21/2013.

Any ideas would be helpful (I've very new to using the Telerik WFP controls).

<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="LatLon.Views.ChartWindow"
        Title="Chart" Height="600" Width="600">
    <Grid>
        <telerik:RadCartesianChart Name="myChart" >
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="Y">
                </telerik:CartesianChartGrid>
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis />
            </telerik:RadCartesianChart.HorizontalAxis>     
            <telerik:SplineSeries  CategoryBinding="XValue" ValueBinding="YValue" >
            </telerik:SplineSeries>
        </telerik:RadCartesianChart>
    </Grid>
</Window>

public partial class ChartWindow : Window
   {
       public DataTable chartDataTable;
       public string yAxisLabel = string.Empty;
       public string xAxisLabel = string.Empty;
       public int xAxisColumn;
       public int yAxisColumn;
 
       public ChartWindow()
       {
           InitializeComponent();
       }
 
       public void Render()
       {
           List<ChartData> ChartDatas = new List<ChartData>();
 
           foreach (DataRow dr in chartDataTable.Rows)
           {
               ChartData cdc = new ChartData();
               cdc.XValue = (DateTime)dr[xAxisColumn];
               cdc.YValue = Convert.ToDouble(dr[yAxisColumn].ToString());
               ChartDatas.Add(cdc);
           }
 
           myChart.HorizontalAxis.LabelInterval = (int)(chartDataTable.Rows.Count / 10);
           myChart.Series[0].ItemsSource = ChartDatas;
 
           myChart.HorizontalAxis.Title = xAxisLabel;
           myChart.VerticalAxis.Title = yAxisLabel;
 
           myChart.HorizontalAxis.LabelFitMode = Telerik.Charting.AxisLabelFitMode.Rotate;
           myChart.HorizontalAxis.LabelRotationAngle = 45;
       }
   }
 
   public class ChartData
   {
       public DateTime XValue { get; set; }
       public double YValue { get; set; }
   }
Petar Marchev
Telerik team
 answered on 14 Apr 2014
4 answers
221 views
Hi,

I have a line series with ChartTrackBallBehavior set, I use the same line series and change the itemsource programmatically when users picks some other field for display.

Same line series with changing itemsource... After few change in itemsource I get the following error... This seems to happen randomly..This seems to happen if you have the mouse over the chart at one place (i.e without MOVING the mouse) before the lineseries is bound to the new collection.

Is there any way to capture the event something like  MouseOver? of the Chart\LineSeries\TrackBall? and handle the exception otherwise it crashes the application with this unhandled exception.

"Value cannot be null. Parameter name: key"
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.GetPresenterToDataPointInfos(List`1 dataPointInfos) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 754
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.FilterDataPointsByClosestCategoryPerAxis(List`1 dataPointInfos) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 731
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.UpdateDataContext(ChartDataContext context) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 373
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.UpdateVisuals() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 340
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.OnMouseMove() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 627
   at Telerik.Windows.Controls.ChartView.ChartTrackBallBehavior.AdornerContainerMouseMove(Object sender, MouseEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartTrackBallBehavior.Branch.cs:line 645
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.MouseDevice.Synchronize()
   at System.Windows.Input.MouseDevice.OnHitTestInvalidatedAsync(Object sender, EventArgs e)
   at System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Petar Marchev
Telerik team
 answered on 14 Apr 2014
2 answers
140 views
Hi Telerik Support,

Currently, I am facing an issue with DragTooltip in RadTreeView. I am currently implementing drag and drop in RadTreeView object using DragDropManager. I am using the databinding to construct the hierarchy. I noted that DragTooltip supposed to display text of the dragover treeview item. However, in my project, DragTooltip is displayed the namespace of the viewmodel which (i.e WpfApplication2.DataItem) instead of the text displayed in treeviewitem (i.e Item2).

Can anyone advice me how to solve the above mentioned issue.


Thanks.

With Best Regards,
Saw
Saw Lwin
Top achievements
Rank 1
 answered on 14 Apr 2014
2 answers
971 views
Hi Telerik Support,

I am using telerik treeview (WPF) in my project. I am using DragDropManager to handle the drag drop events to perform the custom action. The issue I am facing right now is that I want to disable the treeviewitem from dragging based on the runtime value. I saw some thread asking the same question. However, the solution is using the old drag and drop method which is RadTreeView_PreviewDragStarted and some of them are Silverlight. I want to know the solution in WPF.

Thanks.
Saw Lwin
Top achievements
Rank 1
 answered on 14 Apr 2014
1 answer
82 views
Hi, I have a radgridview with ItemSource as binding and all but one column with DataMemberBinding. The exception column is the one which I would like to get user input. However, after typing some stuffs into a cell of that column and pressing enter, the cell will become blank again. Is there a solution or workaround for this?

Thank you for your attention!
Dexter
Top achievements
Rank 1
 answered on 13 Apr 2014
1 answer
129 views
Hello,

I'm currently doing a POC of the use of the RadGridView in our product and we are quite stopped right now.

Indeed, we are using the RadGridView with a binded DataTable containing raw values, columns are unknown untill data is recieved so we use a grid column binding attached property to setup our columns.
We are formatting the cell values using a datatemplate that uses a converter doing custom formatting for us (we cannot use DataFormatString property since there is some complicated Data to format).

Now, we want to introduce a "Search as you type" feature, based on the Demo sample.
This is very well working but as we understand this, it filters the rows based on the binded DataTable raw values.
But as we are doing UI, the user is not seeing those values, but the formatted ones, so he will expect to filter on formatted values somehow.

We don't know if our current design is allowing that but if you have any solution regarding this problem, we'll be glad to hear that.

Regards,,

Benoît
Dimitrina
Telerik team
 answered on 11 Apr 2014
3 answers
138 views
When I printing or Print Previewing of GridView, its takes too much time nearer 15 to 20 minutes for only 250 records of the GridView.

Can you help me?

Regards,
Bharat Mendapara
Dimitrina
Telerik team
 answered on 11 Apr 2014
3 answers
103 views
I have printing problem for GridView when GridView have 15 to 17 columns and more than 300 rows.

(1) When I am printing then it gives error which I atteched image of name with Print1.
(2) When I am previewing of print then its display properly but when I click on Print button then it gives error which I atteched image of name with Print2.

Can you help me?

Regards,
Bharat Mendapara
Dimitrina
Telerik team
 answered on 11 Apr 2014
3 answers
211 views
I have defined two datatemplate:


<DataTemplate x:Key="doubleTemplate">
        <local:DoubleTextBox propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="Text"/>
    </DataTemplate>

and
<DataTemplate x:Key="usrDoubleTemplate">
        <GridName="gridRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <local:DoubleTextBox propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="Text"/>           
            <Label Loaded="LabelUnit_Loaded" Grid.Column="1" Margin="2,0" ContentStringFormat="[{0}]"
                   propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="DataContext"/>
        </Grid>
    </DataTemplate>

When enter in editing mode with keyboard, in the first Datatemplate takes the focus on the TextBox, in the second Datatemplate does not take the focus on the TextBox.

The reason may be the grid?

Any solutions?
Dimitrina
Telerik team
 answered on 11 Apr 2014
1 answer
111 views
My environment
  Visual Studio 2012 Ultimate with Telerik coded UI extension setup
  Telerik UI for WPF 2014 Q1

My question is -- for test automation purpose, can I (how can I) get the data inside a Telerik grid as a whole nested object model?

See the attached picture, it shows how coded UI identify a telerik gridview instance. I put the coded UI identifier on a gridview control. It identify the cell and its property. But that's not what I want. I want to be able to get the data in a grid as in a whole object model way, so I can get the specific row object then cell object.
Yordanka
Telerik team
 answered on 11 Apr 2014
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?