Telerik Forums
UI for WPF Forum
3 answers
587 views
Hi Telerik
In a usercontrol, I have this property in the code behind:

 

public string MyText
        {
            get {return "My text";}
            set {}
        }

 

In xaml, the usercontrol have the name: x:Name="This"

Could you somehow, please help me to get MyText into the header in the menuItem?- the following example, is not working for me: 

 

<telerik:RadToggleButton Tag="{Binding ElementName=This}" Content="Click me" IsChecked="{Binding IsOpen, ElementName=radContextMenu, Mode=TwoWay}">
 
            <telerik:RadContextMenu.ContextMenu >
                <telerik:RadContextMenu x:Name="radContextMenu" Placement="Bottom" IconColumnWidth="0" DataContext="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget.Tag}">
                    <telerik:RadMenuItem Header="{Binding Path=MyText}" />
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
 
        </telerik:RadToggleButton>

Thanks from Kenneth :o)

 

 

 

Kenneth
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
265 views
Hello,
using a RadRichTextBox I am facing the following:
Document is not in readonly mode -> Cursor is visible, can be moved via mouse and keyboard = > okay!
Document is in readonly mode -> Cursor is not visible, but can be moved via mouse and keyboard and shows up on a not expected postion when the document comes back to an editable state again. What can I do against this behaviour?

Another question I have: Is it possible to keep an selection made while in an editable state, but do not permit selection while in "readonly" (setting "isSelectionEnabled" to false)?

Thanks in advance

Jo
Petya
Telerik team
 answered on 11 Dec 2013
1 answer
133 views
Hi guys,

I am struggling mightily with the new ChartView controls. The documentation is severely lacking. I'm trying to use the new RadPieChart and the examples show only the bare minimum. I've looked at the demos - again, simplistic. Where does one add something simple like a chart title? How do you create a legend outside the chart area? The demos show hardcoded values and hardcoded mappings, but in practice this is never the case.

The old RadChart control is well documented, so perhaps it just reflects the newness of the new DLL.

is there an updated CHM? More realistic examples? The online docs are still almost completely silent on RadPieChart and google searches ALL relate to the old RadChart control.

Steve
Tina Stancheva
Telerik team
 answered on 11 Dec 2013
1 answer
134 views
Hi in my wpf application i want to plot two line chart..

and my requirement is i want to show each point in line pointmarker in different color.

i achived this for single line chart, when i try for two lines, both taking the same point mark fill color..

how to resolve this problem.. i am using item series mapping... 
Peshito
Telerik team
 answered on 11 Dec 2013
1 answer
186 views
Hello In my wpf application my requirement is to plot a two line graph with different color of point markers..
 i achived colours for point marker foor single line graph. but if try that method for two line graph am not getting result. am getting single line only,, 

Am getting double line if i use dataseries . but i need to do that by item series,,,

My values are from single tabel, two different columns....

here is my code...


        public void chartmain()
        {
            


            try
            {
        
                var qry = (from s in SvarkWindow.BPList
                           where (s.User_id.Equals(1))
                           orderby s.Test_date ascending
                           select new { s.BP_Score, s.BP_Score_Dia, s.Test_date }).ToList();

                if (qry.Count == 0)
                {
                    SvarkMessageBox.MessageBox.ShowInformation("No Records Found...");
                    radChart.Visibility = System.Windows.Visibility.Hidden;
                   //listStackPanel.Visibility = System.Windows.Visibility.Hidden;

                }
                else
                {

                    radChart.Visibility = System.Windows.Visibility.Visible;

                    List<BPChartHelper> HelperData = new List<BPChartHelper>();
                    List<BPChartHelper> HelperData1 = new List<BPChartHelper>();

                

                    foreach (var item in qry)
                    {
                        SvarkMessageBox.MessageBox.ShowInformation(item.ToString());
                        //lineSeries1.Add(new DataPoint() { YValue = Convert.ToDouble(item.BP_Score), XValue = item.Test_date.ToOADate() });
                        //lineSeries2.Add(new DataPoint() { YValue = Convert.ToDouble(item.BP_Score_Dia), XValue = item.Test_date.ToOADate() });

                        //valueList.Add(new KeyValuePair<DateTime, decimal>(item.Test_date.Date, item.HB_score));
                        HelperData.Add(new BPChartHelper(item.Test_date, item.BP_Score));
                        HelperData1.Add(new BPChartHelper(item.Test_date, item.BP_Score_Dia));


                    }


                
                  


                    SeriesMapping mapping = new SeriesMapping();
                    mapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
                    mapping.ItemMappings.Add(new ItemMapping("Date", DataPointMember.XCategory));
                 radChart.ItemsSource = HelperData;
                    radChart.SeriesMappings.Add(mapping);
                    radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
                    radChart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
                    radChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
                    radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd-MMM";
                    LineSeriesDefinition line = new LineSeriesDefinition();
                    radChart.DefaultSeriesDefinition = line;
                    line.ShowPointMarks = true;
                    line.ShowItemLabels = true;
                    line.Appearance.Stroke = new SolidColorBrush(Colors.DarkGreen);
                    line.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.Black);
                    radChart.DefaultSeriesDefinition.PointMarkItemStyle = this.Resources["MyPointMark_Style"] as Style;
                    radChart.DefaultSeriesDefinition.SeriesItemLabelStyle = this.Resources["MySeriesItemLabel_Style"] as Style;
                    //**********************

                    SeriesMapping mapping1 = new SeriesMapping();
                    mapping1.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
                    mapping1.ItemMappings.Add(new ItemMapping("Date", DataPointMember.XCategory));
                    radChart.ItemsSource = HelperData1;
                    radChart.SeriesMappings.Add(mapping1);
                    radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
                    radChart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
                    radChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;
                    radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "dd-MMM";
                    LineSeriesDefinition line1 = new LineSeriesDefinition();
                    radChart.DefaultSeriesDefinition = line1;
                    line1.ShowPointMarks = true;
                    line1.ShowItemLabels = true;
                    line1.Appearance.Stroke = new SolidColorBrush(Colors.DarkBlue);
                    line1.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.Red);
                    radChart.DefaultSeriesDefinition.PointMarkItemStyle = this.Resources["MyPointMark_Style"] as Style;
                    radChart.DefaultSeriesDefinition.SeriesItemLabelStyle = this.Resources["MySeriesItemLabel_Style"] as Style;




                  

                    this.radChart.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Visible;
                    //**************
                    radChart.DefaultView.ChartLegend.UseAutoGeneratedItems = false;

                    ChartLegendItem item1 = new ChartLegendItem();
                    item1.Label = "BP SYS";
                    item1.MarkerFill = new SolidColorBrush(Colors.DarkGreen);
                    radChart.DefaultView.ChartLegend.Items.Add(item1);
                    ChartLegendItem item2 = new ChartLegendItem();
                    item2.Label = "BP DIA";
                    item2.MarkerFill = new SolidColorBrush(Colors.SkyBlue);
                    radChart.DefaultView.ChartLegend.Items.Add(item2);
                    radChart.DefaultView.ChartLegend.Header = "BP Results";
                    this.radChart.DefaultView.ChartLegend.LegendItemMarkerShape = MarkerShape.StarFiveRay;

                    //**************

                   // this.BPGridView.ItemsSource = qry;

                    //  this.radChart.DefaultView.ChartArea.DataSeries.Add(lineSeries1);
                    // this.radChart.DefaultView.ChartArea.DataSeries.Add(lineSeries2);




                }
            }
        


And My Helper Class.....

class BPChartHelper : INotifyPropertyChanged
    {
        private DateTime _date;
        private SolidColorBrush _pointMarkFill;
        private decimal _yvalue;
        public BPChartHelper(DateTime date, decimal yvalue)
        {
            this._date = date;
            this._yvalue = yvalue;
            this.UpdatePointMarkVisibility();
        }
        public event PropertyChangedEventHandler PropertyChanged;
        public DateTime Date
        {
            get
            {
                return _date;
            }
            set
            {
                if (this._date == value)
                    return;
                this._date = value;
                this.OnPropertyChanged("Date");
            }
        }
        public decimal YValue
        {
            get
            {
                return _yvalue;
            }
            set
            {
                if (this._yvalue == value)
                    return;
                this._yvalue = value;
                this.OnPropertyChanged("YValue");
            }
        }

        
        

        public SolidColorBrush PointMarkFill
        {
            get
            {
                return _pointMarkFill;
            }
            private set
            {
                if (object.Equals(this._pointMarkFill, value))
                    return;
                this._pointMarkFill = value;
                this.OnPropertyChanged("PointMarkVisibility");
            }
        }
        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
        private void UpdatePointMarkVisibility()
        {
            if (this.YValue <=100)
                this.PointMarkFill = new SolidColorBrush(Colors.DarkGreen);
            else if(this.YValue<=105 && this.YValue>=100)
                this.PointMarkFill = new SolidColorBrush(Colors.DarkBlue);
            else if(this.YValue>=105 &&this.YValue<=120)
                this.PointMarkFill = new SolidColorBrush(Colors.Pink);
            else if (this.YValue >= 120 && this.YValue <= 125)
                this.PointMarkFill = new SolidColorBrush(Colors.Orange);
            else if (this.YValue >= 125 && this.YValue <= 130)
                this.PointMarkFill = new SolidColorBrush(Colors.Red);
        }



    }
}



Petar Marchev
Telerik team
 answered on 11 Dec 2013
3 answers
97 views
Hello,

i use RadExpander with theme Expression_Dark. It looks like that, the style of header has been set to standard style. So the header text is black. It will not be seen easily. Have you resolved this problem? Or that is just so specified ;)

Thanks.

Ivan
Stefan
Telerik team
 answered on 11 Dec 2013
1 answer
148 views
Hi everyone,
I can export the whole map image file now using the code below.
using (Stream stream = dialog.OpenFile())
{
    FrameworkElement element = this.m_Radmap.FindChildByType<ItemsPresenter>();
    Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
        element, stream, new PngBitmapEncoder());
}

But the problem is that I have added a few marks on radmap information layer.
How to export these marks together with the map image?
Andrey
Telerik team
 answered on 11 Dec 2013
3 answers
124 views
I have a gauge that has a smaller Min and Max than the allowed values for my needle binding. For instance I have my Min set to 20 and my Max set to 80. The valid range is actually 0-100. 

The needle therefore goes outside of the gauge. Other than putting a valueconverter on the needle value to stop this behaviour is there any built in way I've missed to limit the needle?

Note: The bound property is used elsewhere, where the actual upper and lower limits are valid, so I can't limit it in the class. The only other way I could think of is to create a separate property that does the limiting in the class and then bind to that instead, which I guess would be better performing than a converter.

Thanks...
Andrey
Telerik team
 answered on 11 Dec 2013
1 answer
76 views
Hi,



I tried to use the InformationLayer.GetBestView(items), but it requires to be called several times to have correct result.

(If it is called with MapPinPoint)



Here is the template of the MapPinPoint :



<DataTemplate x:Key="ObstructionPointItemTemplate"><br>
            <telerik:MapPinPoint <br>
                BorderBrush="{StaticResource ObstructionPointColor}"<br>
                Template="{StaticResource PointControlTemplate}" <br>
                telerik:MapLayer.Location="{Binding }"><br>
                <telerik:MapLayer.HotSpot><br>
                    <telerik:HotSpot X="0.5" Y="0.5" /><br>
                </telerik:MapLayer.HotSpot><br>
            </telerik:MapPinPoint><br>
</DataTemplate>






In order to eliminate any side effects with the databinding or the map provider latency, the call to 'GetBestView' is made by an event handler attached to a user interaction (MouseRightButtonDown).



I have a lightweight VS2012 solution were I reproduced the issue, if needed





Can you please help me ?





Thanks in advance
Andrey
Telerik team
 answered on 10 Dec 2013
1 answer
438 views
Hello, I'm using the RichTextBox and cannot get the alignment to work. Here's my code:
radRichTextBox.Insert("Sample Text");
radRichTextBox.ChangeTextAlignment(Telerik.Windows.Documents.Layout.RadTextAlignment.Center);

I would like "Sample Text" to be center aligned but it doesn't work. When adding the control I select the "Text Box or Rich Text Box" option and all the defaults after that. If I select "Word Processor", the alignment code works. Does alignment only work when selecting "Word Processor"? Maybe there's a property I need to add to get the alignment to work when selecting "Text Box or Rich Text Box".

Thanks,
Scott
Svetoslav
Telerik team
 answered on 10 Dec 2013
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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?