Telerik Forums
UI for WPF Forum
1 answer
172 views
I created a simple RadChart with the following code that binds to a collection of data.  The x-axis binds to Date property of DateTIme and the y-axis binds to Quantity property of type Int.  When I try and set a property in ChartARea.AXisX, the UI is not updated.  For example, I try and set LabelRotationAngle = 45.  Nothing happens.  What I see in the x-axis since it is bound to DateTIme values, is LongDateTime format values which is making the x-axis all messy.  I set DefaultLabelFormat="dd-MMM" but the UI doesn't get updated again. 

Can anyone figure out why my chart is not getting updated in the UI.  I've looked at all the Chart Sample Demo's and my XAML looks pretty much the same.  Not sure what I'm doing wrong where the UI does not updated.

Thanks

<telerikChart:RadChart Grid.Row="1" Foreground="White" Background="Transparent" x:Name="RadChart1" ItemsSource="{Binding MetricSum}">
                <telerikChart:RadChart.DefaultView>
                    <Charting:ChartDefaultView>
                        <Charting:ChartDefaultView.ChartArea>
                            <Charting:ChartArea LegendName="chartLegend">
                                <Charting:ChartArea.AxisX>
                                    <Charting:AxisX AutoRange="True" Step="5" DefaultLabelFormat="dd-MMM" LabelRotationAngle="45" IsDateTime="True"
                                                    LayoutMode="Normal" LabelStep="5" TicksDistance="100" Title="XAxis Title">
                                    </Charting:AxisX>
                                </Charting:ChartArea.AxisX>
                            </Charting:ChartArea>
                        </Charting:ChartDefaultView.ChartArea>
                        <Charting:ChartDefaultView.ChartLegend>
                            <Charting:ChartLegend x:Name="chartLegend" Header="Legend" UseAutoGeneratedItems="True"  />
                        </Charting:ChartDefaultView.ChartLegend>
                        <Charting:ChartDefaultView.ChartTitle>
                            <Charting:ChartTitle Content="" HorizontalAlignment="Left" />
                        </Charting:ChartDefaultView.ChartTitle>
                    </Charting:ChartDefaultView>
                </telerikChart:RadChart.DefaultView>
                <telerikChart:RadChart.PaletteBrushes>
                    <SolidColorBrush Color="DarkBlue" />
                    <SolidColorBrush Color="Red" />
                </telerikChart:RadChart.PaletteBrushes>
                <telerikChart:RadChart.SeriesMappings>
                    <Charting:SeriesMapping CollectionIndex="0" LegendLabel="Expected">
                        <Charting:SeriesMapping.SeriesDefinition>
                            <Charting:LineSeriesDefinition ShowPointMarks="True" ShowItemLabels="False" ShowItemToolTips="True" ItemToolTipFormat="Quintiles Expected&#x0a;#X{MMM/yy}&#x0a;value: #Y">
                                <Charting:LineSeriesDefinition.Appearance>
                                    <Charting:SeriesAppearanceSettings StrokeThickness="5"></Charting:SeriesAppearanceSettings>
                                </Charting:LineSeriesDefinition.Appearance>
                            </Charting:LineSeriesDefinition>
                        </Charting:SeriesMapping.SeriesDefinition>
                        <Charting:SeriesMapping.ItemMappings>
                            <Charting:ItemMapping FieldName="Date" DataPointMember="XValue" />
                            <Charting:ItemMapping FieldName="Quantity" DataPointMember="YValue" />
                        </Charting:SeriesMapping.ItemMappings>
                    </Charting:SeriesMapping>
                    <Charting:SeriesMapping CollectionIndex="1" LegendLabel="Actual">
                        <Charting:SeriesMapping.SeriesDefinition>
                            <Charting:LineSeriesDefinition ShowPointMarks="True" ShowItemLabels="False" ShowItemToolTips="True" ItemToolTipFormat="Quintiles Actual&#x0a;#X{MMM/yy}&#x0a;value: #Y">
                                <Charting:LineSeriesDefinition.Appearance>
                                    <Charting:SeriesAppearanceSettings StrokeThickness="5"></Charting:SeriesAppearanceSettings>
                                </Charting:LineSeriesDefinition.Appearance>
                            </Charting:LineSeriesDefinition>
                        </Charting:SeriesMapping.SeriesDefinition>
                        <Charting:SeriesMapping.ItemMappings>
                            <Charting:ItemMapping FieldName="Date" DataPointMember="XValue" />
                            <Charting:ItemMapping FieldName="Quantity" DataPointMember="YValue" />
                        </Charting:SeriesMapping.ItemMappings>
                    </Charting:SeriesMapping>
                </telerikChart:RadChart.SeriesMappings>
            </telerikChart:RadChart>
Nikolay
Telerik team
 answered on 20 Aug 2010
1 answer
149 views
Hello,
I bound the RadTreeView to an ObservableCollection of TreeFolderHierarchyItem (my object)
public class TreeFolderHierarchyItem : INotifyPropertyChanged
    {
        #region properties
        private string _header;
        private bool _isexpanded;
        private string _defaultimagesrc;
        private string _expandedimagesrc;
        private string _collapsedimagesrc;
        private TreeFolderItem _tag;
        private TreeFolderHierarchy _items;
        public string Header
        {
            get { return _header; }
            set
            {
                if (value != _header)
                {
                    _header = value;
                    OnPropertyChange("Header");

                }
            }
        }
        public bool IsExpanded
        {
            get { return _isexpanded; }
            set {
                if (value != _isexpanded)
                {
                    _isexpanded = value;
                    OnPropertyChange("IsExpanded");
                }
            }
        }
        public string DefaultImageSource
        {
            get { return _defaultimagesrc; }
            set
            {
                if (value != _defaultimagesrc)
                {
                    _defaultimagesrc = value;
                    OnPropertyChange("DefaultImageSource");
                }
            }
        }
        public string ExpandedImageSource
        {
            get { return _expandedimagesrc; }
            set
            {
                if (value != _expandedimagesrc)
                {
                    _expandedimagesrc = value;
                    OnPropertyChange("ExpandedImageSource");
                }
            }
        }

        public string CollapsedImageSource
        {
            get { return _collapsedimagesrc; }
            set
            {
                if (value!= _collapsedimagesrc)
                {
                    _collapsedimagesrc = value;
                    OnPropertyChange("CollapsedImageSource");
                }
            }
        }
        public TreeFolderItem Tag
        {
            get { return _tag; }
            set
            {
                if (value != _tag)
                {
                    _tag = value;
                    OnPropertyChange("Tag");
                }
            }
        }
        public TreeFolderHierarchy Items
        {
            get
            {
                return _items;
            }
            set
            {
                if (value != _items)
                {
                    _items = value;
                    OnPropertyChange("Child");
                }
            }
        }
        public int ID
        {
            get { return Tag.ID; }
            set {
                if (value != Tag.ID)
                {
                    Tag.ID = value;
                    OnPropertyChange("ID");
                }            
            }
        }
 
        public TreeFolderHierarchyItem(TreeFolderItem tag, bool isexpanded )
        {
            _items = new TreeFolderHierarchy();
            if (tag == null)
                throw new ArgumentException();
            _tag = tag;

            SetProperties(isexpanded);

        }
        private void SetProperties(bool isexpanded)
        {
            _header = _tag.Titre;
            _isexpanded = isexpanded;            
            switch (_tag.Type)
            {
                case TreeFolderType.Acte:
                    _defaultimagesrc = "folder.png";
                    _expandedimagesrc = "openedfolder.png";
                    _collapsedimagesrc = "folder.png";
                    break;
                case TreeFolderType.Message:
                    _defaultimagesrc = "sent.png";
                    _expandedimagesrc = "sent.png";
                    _collapsedimagesrc = "sent.png";
                    break;
                case TreeFolderType.Pdf:
                    _defaultimagesrc = "3Drafts.png";
                    _expandedimagesrc = "3Drafts.png";
                    _collapsedimagesrc = "3Drafts.png";
                    break;
                case TreeFolderType.Libre:
                    _defaultimagesrc = "1PersonalFolder.png";
                    _expandedimagesrc = "1PersonalFolder.png";
                    _collapsedimagesrc = "1PersonalFolder.png";
                    break;
            }
 

        }

  
        #endregion

        public event PropertyChangedEventHandler PropertyChanged;


        // Helper Methods
        private void OnPropertyChange(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(thisnew PropertyChangedEventArgs(propertyName));
            }
        }
    }

Since this this an observablecollection, I just need to add a new TreeFolderHierarchyItem object to my observable collection
Adding new Item works fine and RadTreeView control refreshs correctly with the new item. But I want, enter in edit mode for this new item in order to change its header .
using MyRadViewTree.ItemContainerGenerator.ContainerFromIndex(0) returns always null even when all the node are expanded . So I am not able to iterate into the hierarchy ...
I thought to set IsEditMode=True but when I calls MyRadTreeVieew.Items I get my Observable collection of TreeFolderHierarchyItem  as expected but useless for setting the EditMode ..
What am I doing wrong ?
Thanks for your help

Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
1 answer
202 views
Hi

Can we set the width of the tabcontrol according to the containter Control?

For eg:
The tab control size should increase according to the usercontrol size.
Miro Miroslavov
Telerik team
 answered on 20 Aug 2010
4 answers
168 views
Hi,

I know there is new feature in current version copy paste into excel. but i found only demo. would you please provide me example in C#.


RadControls for WPF Trial Version: 2010.2 812 

thank you.

Yavor Georgiev
Telerik team
 answered on 19 Aug 2010
2 answers
442 views
Hello,

I would like to have the Slider thumb control move to the correct position when I set the value programmatically.  How would I go about doing this?

Thanks
Ryan Black
Ryan Black
Top achievements
Rank 1
 answered on 19 Aug 2010
4 answers
533 views
Hi,
We are having trouble getting a RadDock in WPF to resize to the height/width of it's container.  We'd like it to be 100% of the grid row's height and width so it adjusts to the size of the window as it's the main area users will work in.

We want a RadRibbon to appear at the top of the screen in a manner where the user cannot remove it then have the docking area for windows appear beneath that taking up the remaining space in height.

<Window x:Class="Company.ApplicationName.UI.DesktopClient.Windows.Main"
    xmlns:controls="clr-namespace:Company.ApplicationName.UI.DesktopClient.Controls"
    Title="Main" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    WindowStartupLocation="CenterScreen"
    WindowState="Maximized" Height="600" Width="700" Icon="/Company.ApplicationName.UI.DesktopClient;component/Resources/application_icon.png">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <telerik:RadRibbonBar Margin="0,0,0,0" Name="radRibbonBar1" VerticalAlignment="Top" Title="Main Dashboard" ApplicationName="Available To Promise" ApplicationButtonImageSource="/Company.ApplicationName.UI.DesktopClient;component/Resources/application_logo.png" ClipToBounds="True" >
            <telerik:RadRibbonBar.ApplicationMenu>
                <telerik:ApplicationMenu>
                    <telerik:RadRibbonButton LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/save.png" Text="Save"/>
                    <telerik:RadRibbonButton LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/exit.png" Text="Exit"/>
                </telerik:ApplicationMenu>
            </telerik:RadRibbonBar.ApplicationMenu>
  
            <telerik:RadRibbonTab Header="Home">
                <telerik:RadRibbonGroup Header="Clipboard">
                    <telerik:RadRibbonSplitButton Text="Paste" LargeImage="/Company.ApplicationName.UI.DesktopClient;component/Resources/MenuItems/paste.png" Size="Large"
              telerik:ScreenTip.Title="Paste(Ctrl+V)"
              telerik:ScreenTip.Description="Paste the contents the Clipboard.">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <telerik:RadContextMenu BorderThickness="0">
                                <telerik:RadMenuItem Header="Paste"/>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Admin">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="View"/>
            </telerik:RadRibbonBar>
            <telerik:RadRibbonTab Header="Planning">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Reports">
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Modeling Scenarios">
            </telerik:RadRibbonTab>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <telerik:RadDocking ClipToBounds="True" Margin="0,0,0,0" AllowUnsafeMode="True" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" >
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadPane Header="Description">
                            <TextBlock TextWrapping="Wrap" Text="On the Documents tab above press Ctrl + Mouse Left button to display the Popup Menu. You can use the same combination on every tab."/>
                        </telerik:RadPane>
                        <telerik:RadPane Header="NonDraggable" CanFloat="False">
                            <TextBlock TextWrapping="Wrap" Text="This pane cannot be dragged, because it has its property CanFloat set 'False'."/>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
  
            <telerik:RadSplitContainer InitialPosition="DockedLeft" VerticalAlignment="Bottom">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Progress/Schedule">
                        <controls:ProgressBar></controls:ProgressBar>
                    </telerik:RadPane>
                    <telerik:RadPane Header="Server Explorer"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer InitialPosition="DockedRight">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Properties"/>
                    <telerik:RadPane Header="Solution Explorer"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer InitialPosition="DockedBottom">
                <telerik:RadPaneGroup>
                    <telerik:RadPane Header="Output"/>
                    <telerik:RadPane Header="Error List"/>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
        </telerik:RadDocking>
            </Grid>
          
    </Grid>
</Window>
jgill
Top achievements
Rank 1
 answered on 19 Aug 2010
1 answer
331 views
I have a grid where the rows have a DatePicker and a DropDown. I want to disable the DropDown if the DatePicker is empty. I have this in my grid:

 

<telerik:GridViewDataColumn DataFormatString="d" Header="Termination" DataMemberBinding="{Binding TerminationDate}" >
<telerik:GridViewDataColumn.CellEditTemplate>
<DataTemplate>                                                        
<telerik:RadDatePicker x:Name="TerminationDate" SelectedDate="{Binding Path=TerminationDate, Mode=TwoWay}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
  
<telerik:GridViewComboBoxColumn                                                
x:Name="TerminationReasonType"
Header="Beneficiary Terminated"
ItemsSource="{Binding Path=ReferenceData.AllBeneficiaryTerminationReasonType}"
DisplayMemberPath="Description"
SelectedValueMemberPath="_BeneficiaryTerminationReasonTypeID.Id"
DataMemberBinding="{Binding TerminationReasonID,UpdateSourceTrigger=PropertyChanged}">

<!--
<
telerik:GridViewComboBoxColumn.Style>
<Style TargetType="telerik:GridViewComboBoxColumn">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TerminationDate}" Value="{x:Null}">
<Setter Property="FrameworkElement.IsEnabled" Value="false"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:GridViewComboBoxColumn.Style>
-->                                            
</telerik:GridViewComboBoxColumn>

 

 

 

I have tried the commented code but did not work. I can not reach the TerminationDate element.
Ideas?
Thx

 

 

 

 

 

Maya
Telerik team
 answered on 19 Aug 2010
2 answers
112 views
I would like to open two different context menus when user righ clicks on GridView Column and GridView Row.
I take a look on samples provided and both sample has only one of the right click enabled either for GridViewRow or GridViewColumn. Please provide guidance on it.
samir
Top achievements
Rank 1
 answered on 19 Aug 2010
5 answers
1.0K+ views
Hi,
I just spend the whole day to find out why my RadGridView is not working like I thought it should.
No matter where and how (xaml | c#) I put my GroupDescriptions and AggregateFunctions the GridView always showed a different behaviour and never did what I wanted it to do. Sometimes the grouping failed sometimes the aggregates failed and sometimes it worked after removing and adding the groups multiple times from code-behind. I finally took a telerik sample (http://www.telerik.com/community/forums/wpf/gridview/group-header-with-aggregated-functions.aspx) and changed it to use a DataTable instead of ObservableCollection ==> and suddenly the demo worked as weird as my application. In WPF you always have to bind to the DefaultView(or any other DataView) if you want a working TwoWay-Binding to a DataTable. Because I had no more idea what to try I just bound to the DataTable instead of DataTable.DefaultView ==> and everything started working as expected.

Are DataViews not supported anymore???

Best Regards
Steffen   
Steffen
Top achievements
Rank 1
Veteran
 answered on 19 Aug 2010
2 answers
125 views
Hi All
I have a listbox and a pie chart and you can drag from the listbox to the chart to populate it with some default values.

The scenario I am trying to actually implement is this: When the user clicks on a pie segment, a popup/new window (ideally I would like to use a DialogWindow so once the user clicks on a segment, they will be forced to edit or cancel their edit) opens up and allows the user to change the underlying data of the segment. At the same time, if the user clicks and drags the pie segment, it is removed from the chart.

I am handling all the drag and drop and the ItemClick event. The problem is that ItemClick is fired when the mouse button is pressed, NOT when it is released - that is, it responds to MouseDown rather than MouseClick. Therefore I cannot implement this scenario because as soon as the user clicks, the popup is shown and they are unable to perform any drag and drop.

In short, I would like to click and edit or click and drag. I also tried using the MouseUp event, but this is fired all over the RadChart. I want this to only happen when the user clicks on just a pie segment and so far I cannot seem to find a working solution.

Is there anyway to get around this limitation. This functionality is a requirement for us, but so far we don't seem to have a clean solution for the problem. Hope the Telerik team can give us some ideas.

Thank you very much. We are using 2010 Q1SP2 and 2010Q2Beta.
Sparky
Top achievements
Rank 1
 answered on 19 Aug 2010
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?