Telerik Forums
UI for WPF Forum
4 answers
176 views
I used the following in a console app to create and save Chart to png.
It works for LineSeries but the BarSeries is missing.
Please help.



using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Threading;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Charting;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            Processor processor = new Processor();
            processor.Process();
        }
    }

    public class Processor
    {
        private SaveChartProcessor _ruleProcessor = new SaveChartProcessor();
        public void Process()
        {
            var processRuleThread = new Thread(workerThreadProcessRule);
            processRuleThread.Start();
        }

        private void workerThreadProcessRule()
        {
            _ruleProcessor.SaveImage();
        }
    }


    public class SaveChartProcessor
    {
        public void SaveImage()
        {
            var newThread = new Thread(processChartImageWorker);
            newThread.SetApartmentState(ApartmentState.STA);
            newThread.Start();
        }

        public void processChartImageWorker()
        {
            var chart = new RadChart();
            chart.BeginInit();

            chart.Width = 640;
            chart.Height = 480;
            chart.DefaultView.ChartArea.EnableAnimations = false;

            SeriesMapping sm1 = new SeriesMapping();
            //sm1.SeriesDefinition = new LineSeriesDefinition();   //<-LineSeries works
            sm1.SeriesDefinition = new BarSeriesDefinition();      //<-BarSeries doesn't work
            sm1.LegendLabel = "Line Series 1";
            sm1.CollectionIndex = 0;
            ItemMapping im1 = new ItemMapping();
            im1.DataPointMember = DataPointMember.YValue;
            sm1.ItemMappings.Add(im1);
            SeriesMapping sm2 = new SeriesMapping();
            //sm2.SeriesDefinition = new BarSeriesDefinition();
            sm2.SeriesDefinition = new LineSeriesDefinition();
            sm2.LegendLabel = "Line Series 2";
            sm2.CollectionIndex = 1;
            ItemMapping im2 = new ItemMapping();
            im2.DataPointMember = DataPointMember.YValue;
            sm2.ItemMappings.Add(im2);

            // Force chart to measure itseft so it provides the actual width and height to export
            chart.Measure(new System.Windows.Size(chart.Width, chart.Height));
            chart.Arrange(new System.Windows.Rect(chart.DesiredSize));

            chart.SeriesMappings.Add(sm1);
            chart.SeriesMappings.Add(sm2);

            chart.EndInit();

            var itemsSource = new List<double>[] { new List<double> { 9, 2, 3, 4 }, new List<double> { 5, 7, 3, 4 } };
            chart.ItemsSource = itemsSource;

            string path = "d:\\newpic.png";

            chart.Dispatcher.Invoke(
                    new Action(() =>
                    {
                        chart.Save(path);
                    }),
                    DispatcherPriority.Normal);
        }
    }
}
Sia
Telerik team
 answered on 08 Aug 2011
1 answer
137 views
Hi Telerik,

we are unable select an item through code. we used the item.IsSelected=true. though it highlited in different color from the one which is shown when we clicked manually. Please could you help us resolving this.
Petar Mladenov
Telerik team
 answered on 08 Aug 2011
1 answer
84 views
How do i do this?

the scenario is that i have this certain student collection, each student can choose all or some of his enrolled subjects from the multiselect control.

how would you guys do this with a RadGridview Column?

Using mvvm, I tried binding the gridviewcomboboxcolumn with a Keyvaluepair of id  and a checkbox collection, but when i tried to show it, it doesn't display the checkbox control in the combo box.
Vanya Pavlova
Telerik team
 answered on 08 Aug 2011
5 answers
264 views
Hi

Just wondering if there is a CRUD example with ef4.0

cheers

Jason
Rossen Hristov
Telerik team
 answered on 08 Aug 2011
1 answer
130 views
Hi,

I found this post in the Telerik blogs that provides a simple way to reorder rows by dragging and dropping.  The blogger provided source code to use.  However, the WPF Telerik dll files are from 2010 and therefore I upgraded them to 2011 Q2.  After I had upgraded the dll's, the size of the rows that were being dragged by the mouse increased and expanded to the whole width screen.  In other words, they looked like they were being magnified or zoomed in.  I didn't change any of the source code.  I just upgraded the Telerik dlls.  Is there anyway to make the dragged rows appear normal in size?

Here is the link to the blog:
 http://blogs.telerik.com/silverlightteam/posts/10-05-20/enable-radgridview-rsquo-s-rows-reorder-functionality-using-behaviors.aspx

I don't see how to attach the entire solution, but if you download the WPF solution from the link and then upgrade the WPF Telerik dlls to 2011 Q2, you should hopefully be able to recreate the drag & drop size issue.

Thanks,
Joe
Vanya Pavlova
Telerik team
 answered on 08 Aug 2011
0 answers
69 views
Moving this to Silverlight Forum
Roland
Top achievements
Rank 1
 asked on 08 Aug 2011
4 answers
191 views

Hi,

I want to collapse the hierarchy expand button (its border container to be accurate) so there will be no white space at the first column content when there is no hierarchy.

I saw that there is a property in the radTreeListView called HasHierarchy, but I cannot change its value (the set is not accessible).

I’ve managed to this in code:

            var gridHierarchyBorder = treeListView.FindChildByName("PART_HierarchyIndent") as Border;

            if (gridHierarchyBorder == null)

                return;

            gridHierarchyBorder.Visibility = Visibility.Collapsed;

But I guess there is a more efficient and elegant way to achieve this. Is there?

Rotem
Top achievements
Rank 1
 answered on 07 Aug 2011
4 answers
140 views
I'm trying to render the RadMap as an image at the request of a user via a command. I need the command to be disabled until the RadMap is finished rendering otherwise it is possible for the rendered image to be missing parts of the map. How do I know when the RadMap is finished rendering?   
D Warren
Top achievements
Rank 1
 answered on 05 Aug 2011
2 answers
271 views
I'm trying to render the RadChart as an image at the request of a user via a command. I need the command to be disabled until the RadChart is finished rendering otherwise it is possible for the rendered image to be missing parts of the chart. How do I know when the Rad Chart is finished rendering?
D Warren
Top achievements
Rank 1
 answered on 05 Aug 2011
1 answer
128 views
Hi,

How override the default HighlightItem template. In scheduleview we have ResizeHighlightStyle, DragDropHighlightStyle, MouseOverHighlightStyle, SelectionHighlightStyle and SpecialSlotStyleSelector. With this we can override the these styles. What is the property to change the style for HighlightItem...
Pana
Telerik team
 answered on 05 Aug 2011
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
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
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?