Telerik Forums
UI for WPF Forum
3 answers
153 views
Hi All, 
I am using WPF RadChart , to create and export charts in code behind, everything is ok in all chart type same as bubble , pie , linear, … but in Bar chart using BarSeriesDefinition, the exported Image has no bar! Labels are shown correctly above hidden bars! Also created chart is shown correctly in WPF RadChart.
in this below code I show the problem
Regards


private void Button_Click(object sender, RoutedEventArgs e)
        {
            ChartBaseParameter ChartParam = new ChartBaseParameter()
            {
                XAxisField = "x",
                YAxisFields = new List<string>() { "y" }
            };
 
            DataTable dt = new DataTable();
            dt.Columns.Add("x", typeof(int));
            dt.Columns.Add("y", typeof(int));
            dt.Rows.Add(1, 1);
            dt.Rows.Add(2, 2);
 
            this.ChartPanel.SeriesMappings.Clear();
            this.ChartPanel.SortDescriptors.Clear();
            this.ChartPanel.ItemsSource = null;
 
            var chart = InitChart(this.ChartPanel, ChartParam, true, dt);
            var fileName = "C:\\myChart.jpg";
            chart.ExportToImage(fileName, new PngBitmapEncoder());
        }
 
    
        public static RadChart InitChart(RadChart chartPanel, ChartBaseParameter chartParam, bool showError, System.Data.DataTable chartTable)
        {
            bool showItemLabels = true;
 
            AnimationManager.IsGlobalAnimationEnabled = false;
            chartPanel.DefaultView.ChartArea.EnableAnimations = false;
 
            chartPanel.BeginInit();
            chartPanel.Width = 300;
            chartPanel.Height = 300;
 
            BarLabelSettings barLabelSetting = new BarLabelSettings();
            barLabelSetting.Distance = 10;
            barLabelSetting.LabelDisplayMode = LabelDisplayMode.Outside;
            barLabelSetting.ShowConnectors = true;
 
            foreach (var YItem in chartParam.YAxisFields)
            {
 
                SeriesMapping seriesmappingi = new SeriesMapping() { LegendLabel = YItem };
                seriesmappingi.SeriesDefinition = new BarSeriesDefinition() { ShowItemLabels = showItemLabels, LabelSettings = barLabelSetting };
                seriesmappingi.ItemMappings.Add(new ItemMapping("y", DataPointMember.YValue) { FieldType = typeof(int) });
                seriesmappingi.ItemMappings.Add(new ItemMapping("x", DataPointMember.XCategory) { FieldType = typeof(int) });
                seriesmappingi.ItemMappings.Add(new ItemMapping("x", DataPointMember.LegendLabel) { FieldType = typeof(int) });
                chartPanel.SeriesMappings.Add(seriesmappingi);
            }
 
            chartPanel.DefaultView.ChartArea.AxisX.LabelRotationAngle = -90;
            chartPanel.DefaultView.ChartArea.ZoomScrollSettingsX.MinZoomRange = 0.01;
            chartPanel.DefaultView.ChartArea.AxisX.Title = chartParam.XAxisField;
 
            chartPanel.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom;
            chartPanel.DefaultView.ChartArea.AxisY.ExtendDirection = AxisExtendDirection.Both;
            chartPanel.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.None;
 
            chartPanel.DefaultSeriesDefinition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;
 
            chartPanel.EndInit();
             
            chartPanel.Measure(new Size(1024, 768));
            chartPanel.Arrange(new System.Windows.Rect(new Point(0, 0), chartPanel.DesiredSize));
             
            chartPanel.ItemsSource = chartTable;
            chartPanel.Rebind();
            chartPanel.UpdateLayout();
            return chartPanel;
        }
 
    }
    public class ChartBaseParameter
    {
        public string XAxisField;
        public List<string> YAxisFields;
    }

Petar Marchev
Telerik team
 answered on 31 Dec 2014
3 answers
1.8K+ views
I want to change background color of a particular cell programmatic-ally in wpf telerik radgridview, I have referred  various examples which you have given that using static columns like  (telerik.GridViewDataColumn).

but in my project GridViewDataColumn are not static, it comes dynamically using collections. In this situation how we can handle this? .

please help me as soon as possible . 
Dimitrina
Telerik team
 answered on 31 Dec 2014
14 answers
235 views
Hi every one

in RichTextBox control it offers that i can add new comment for selected test by InsertCommentCommand function
how can i custom this comment by adding a custom user control instead of text control that i put my comment inside it?

thanks every one.
Ramalingam
Top achievements
Rank 1
 answered on 31 Dec 2014
2 answers
79 views
Hi there,
I've a GridView with an observablecollection, "observation" works, but not when filterdescriptors are specified.
Am I doing something wrong or it's an issue of RadDataGrid?

v2014.3

Thanks
Dimitrina
Telerik team
 answered on 30 Dec 2014
8 answers
364 views
Hi,

using c# .NET 4.5, Wpf, RadTabControl (DataContext is a TabViemodel).

I bound a VieModel on my RadTabControl. With a Command on a RadButton, i add a new TAbItem and load a UserControl
as Contet.

On initializing the USerControl i try to access the ViewModel from the TAbControl, but without any success. As you can see on
the attached File the SelectedContent is my VieModel, but the var yyy is null?

Thanks
Best Regards
Rene
ITA
Top achievements
Rank 1
 answered on 30 Dec 2014
4 answers
216 views
Environment: WPF,MVVM, Odata 2, EF6, MVC

Scenario: 

Attempting to submit a master/detail payload as a single transaction via a Telerik QueryableDataServiceCollectionView. Payload consists of 1 master record and 12 related detail records for insert.  

I have included the following code in WebApiConfig:

config.Routes.MapHttpBatchRoute(
        routeName: "WebApiBatch",
        routeTemplate: "api/$batch",
        batchHandler: new DefaultHttpBatchHandler(GlobalConfiguration.DefaultServer));

 and 

 config.Routes.MapODataRoute(
"odata",
"odata",
builder.GetEdmModel(),
batchHandler: new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));

Now on the Client side, I don't know how to tell the QueryableDataServiceCollectionView to transmit the payload as a single transaction when SubmitChanges() is called.

ViewModel Constructor:

this.odataScoreService = odataScoreService;
odataScoreService.Service.SaveChangesDefaultOptions = SaveChangesOptions.Batch;

ProjectPhaseScores = new QueryableDataServiceCollectionView<ProjectPhaseScore>(odataScoreService.Service, odataScoreService.Entity);
ProjectPhaseScores.Expand = "ScoreItems";
ProjectPhaseScores.LoadedData += OnLoadedScoreData;
ProjectPhaseScores.FilterDescriptors.Add(projectPhaseFilterDescriptor);


I am still very new to Visual Studio Development so any assistance would be greatly appreciated.


Dimitrina
Telerik team
 answered on 30 Dec 2014
1 answer
102 views
How to read content from RadRichTextBox in codebehind

Thanks
Bindu
Tanya
Telerik team
 answered on 30 Dec 2014
1 answer
179 views
I've just started working with Telerik UI for WPF and have been working with implicit styles. I got the implicit styles working but haven't been able to access the theme variations as detailed in the documentation. I inserted the variation code into my code-behind file as shown below:

 public partial class MainWindow : Window
    {
        public MainWindow()
        {
            //dark color variation
            VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
            InitializeComponent();
        }
    }

But get the following error message:

Error 1 The name 'VisualStudio2013Palette' does not exist in the current context 

Any ideas?




Bart
Top achievements
Rank 1
 answered on 29 Dec 2014
1 answer
134 views
Hi,

I get an error when I try to remove a tab item containing a RadAutoCompleteBox regardless of the content of the box -even if it's empty- it still gives an error. It breaks with an "Object is not set to an instance of an object" error trying to load RadAutoCompleteBox .cs at line 1326 0x30 bytes.

Thanks in advance.
Nasko
Telerik team
 answered on 29 Dec 2014
7 answers
240 views
For a customer project we are working with the radscheduleview (Q2 2014).

We are using specialslots to display slots with different task type. These slots can have a recurrence pattern which is supported by the Slot class.
We are able to display slots which occur daily every second day for example.

Where we run into problems is when we want to start using exceptions on the recurrencepattern. For example recurrence should be removed on a specific date.
For appointments the recurrencerule is used to add/delete exceptions of the recurrencepattern. We would like to be able to do the same for specialslots and are actually supprised that this is not a feature that is supported by the Slot class.

Is it currently possible possible to add exceptions to Slots or would it be possible too add such a feature?

Regards,
Johan Lollinga
Ideo B.V.
Johan
Top achievements
Rank 1
 answered on 29 Dec 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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?