Telerik Forums
UI for WPF Forum
2 answers
102 views
We use prism with RadDocking
In the Shell view we have this region :


<telerik:RadSplitContainer InitialPosition="DockedRight" telerik:ProportionalStackPanel.RelativeSize="200, 10">
<telerik:RadPaneGroup prism:RegionManager.RegionName="{x:Static inf:RegionNames.RightSidebarRegion}"/>
</telerik:RadSplitContainer>

When we inject this view  that has IsPinned="False"

<Telerik:RadPane …............….. IsPinned="False">
<Grid>
      <TextBlock Text="some text"/>
</Grid>
</Telerik:RadPane>

We notice that when we navigate to view that have not pane,
the pas injected in the precedent view not removed

IRegion sidebarRegion =  RegionManager.Regions[RegionNames.RightSidebarRegion];
SideBars.ToList().ForEach(sidebarRegion.Remove);

Can you give me a solution for this behavior?


George
Telerik team
 answered on 05 Jan 2015
2 answers
232 views
EDIT: I solved the issue, I just had to create a new background worker for each series.

Hey peeps,

I'm just getting started with Telerik's controls and have successfully managed to plot a multi series chart. Now due to the time it takes to populate the chartdata, I wanted to do this with a background worker. I successfully managed to have a backgroundworker plot a single chartseries, but I don't know how to have it plot multiple. Lets look at the code:


public BackgroundWorker worker = new BackgroundWorker();
 public Window1()
 {
     InitializeComponent();
     InitializeBackgroundWorker();
 }
 
 // Set up the BackgroundWorker object by 
 // attaching event handlers. 
 private void InitializeBackgroundWorker()
 {
     worker.DoWork +=new DoWorkEventHandler(worker_DoWork);
     worker.RunWorkerCompleted +=new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
 }
 
 //Define a New Chart Data Class for each graph
 public class ChartDataClass1
 {
     public double X1 { get; set; }
     public double Y1 { get; set; }
 
     public ChartDataClass1()
     {
 
     }
 }
 
 public class ChartDataClass2
 {
 
     public double X2 { get; set; }
     public double Y2 { get; set; }
 
     public ChartDataClass2()
     {
 
     }
 }
 
 private void btn1_Click(object sender, RoutedEventArgs e)
 {
     worker.RunWorkerAsync();
 }
 
 void worker_DoWork(object sender, DoWorkEventArgs e)
 {
     // On the worker thread...cannot make UI calls from here.
     e.Result = MTLB(worker,e);
 
 
private void worker_RunWorkerCompleted(
     object sender, RunWorkerCompletedEventArgs e)
 {
      
     // First, handle the case where an exception was thrown.
     if (e.Error != null)
     {
         MessageBox.Show(e.Error.Message);
     }
 
     else
     {
         // Finally, handle the case where the operation 
         // succeeded.
         xline.Series[0].ItemsSource = (System.Collections.IEnumerable)e.Result;
     }
 
 }
 
 public System.Collections.Generic.List<ChartDataClass1> MTLB(BackgroundWorker worker, DoWorkEventArgs e)
 {
     int st = 1;
     int sp = 20;
  
     //MATLAB inputs
     MWNumericArray start = 1;
     MWNumericArray stop = 20;
 
     //MATLAB fn
     Reactor.Class1 rxtr_lib = new Reactor.Class1();
     MWArray[] result = rxtr_lib.rxtr(1, start, stop);
     System.Array NH3 = new double[2 * (sp - st + 1)];
     NH3 = ((MWNumericArray)result[0]).ToVector(MWArrayComponent.Real);
 
 
     List<ChartDataClass1> chartData1 = new List<ChartDataClass1>();
     List<ChartDataClass2> chartData2 = new List<ChartDataClass2>();
     for (int i = 0; i < (sp - st); i++)
     {
         ChartDataClass1 cdc = new ChartDataClass1();
         ChartDataClass2 cdc2 = new ChartDataClass2();
         cdc.X1 = i;
         cdc.Y1 = Convert.ToDouble(NH3.GetValue(2 * i));
         cdc2.X2 = i;
         cdc2.Y2 = Convert.ToDouble(NH3.GetValue(2 * i + 1));
 
         chartData1.Add(cdc);
         chartData2.Add(cdc2);
     }
      
     return chartData1;
     
}

The code above populates chartData1 and chartData2, but only allows me to return a single type(chartdataclass1 OR chartdataclass2). My question is, what must I do so that I can return chartData1 AND chartData2 to e.Result? Also, assuming I can return both, how do I then set up e.Result such that I can define Series[0] and Series[1] using e.Result?

Martin Ivanov
Telerik team
 answered on 05 Jan 2015
4 answers
420 views
Hi !

I'm developing  grid excel exporting using ExcelML with UI For WPF Q1 2014 SP1 in WPF Application.

There is a problem that multi line Carriage Returns(\r\n or \n) is not working in a cell  when exporting grid using ExcelML.

SpreadML ( Open Xml at office )

I had searched and found a content. 

This is content that was written in 2009 years.

This content is written that newline characters are not supported in ExcelML format by the Telerik team.

http://www.telerik.com/forums/carriage-returns-when-exporting-grid-using-excelml

Please, What is the solution of  this problem ?


JUNGGON
Top achievements
Rank 1
 answered on 05 Jan 2015
1 answer
266 views

I am using the Office2013 theme.What is the easiest way to change the application font?

I can see that the Windows8 themes have an option for this:

//Windows8 Resources
Windows8Palette.Palette.FontSizeXS = 10;
Windows8Palette.Palette.FontFamily = new FontFamily("Segoe UI");

Dimitrina
Telerik team
 answered on 02 Jan 2015
1 answer
147 views
I am using PRISM/Unity and Telerik's WPF controls to create a business solution for generating and viewing reports.  I have a module that is dedicated to simply displaying the generated reports.  My View for the reports originally was implmented as a <Window> </Window> with a single <ReportViewer> with the report data source bound to a backing field in the ViewModel for the Window.  I am now attempting to convert to a tabbed control structure to allow the users to view more than one report at a time.  I VM defined as a static resource in the window and the codebehind of the window exposes a single method that allows the addition of reports to its tab control (given that it's entirely a piece of display functionality, I don't think it violates the MVVM principles.

Back to the question:  during the add process, I generate an instance report source and add it to an ObserableCollection<InstanceReportSource> that is the ItemSource bound to the "ItemSource" property of the tab control and then show the window that contains the Tab Control. During the AddReport method, I perform a RaisePropertyChanged("ReportSourceCollection") to notify the Tab control that it needs to add a new tab containing a report.  The issue I'm running into is that when the window opens, no report is displayed.  Through my debugging, I've found that the addition of items, and property changed events are properly raised.

Has anyone else had an issue with Report Viewer in the Tab control?

Thanks.
Petar Marchev
Telerik team
 answered on 02 Jan 2015
8 answers
468 views
Hello,

I'm attempting to ILMerge a couple of the control DLLs into another DLL and am having problems where the controls are not able to be loaded at run time. My assumption is that I would need to implement something like what is suggested here for the WinForms controls, but can not find any pre-existing forum discussions or articles on the subject.

Am I missing something, any thoughts/suggestions?

Thanks!
William
Top achievements
Rank 1
 answered on 31 Dec 2014
3 answers
135 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
220 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
74 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
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?