Telerik Forums
UI for WPF Forum
2 answers
112 views
Hi,
I have a PanelBar that is templated by a HierarchicalDataTemplate.  The PanelBar also includes a ContextMenu, and when I select "Rename" in the ContextMenu I would like the selected List Item to switch to an ItemEditTemplate.  However, the HierarchicalDataTemplate doesn't provide that option and putting an ItemEditTemplate in the PanelBar doesn't seem to do anything when I switch the item IsInEditMode = true.  What do I have to do to switch to my EditItemListTemplate?  Thank you for your help!!

Edit: I am developing in .Net 3.5 C#, using Telerik WPF 2011.03.1219.0.

<HierarchicalDataTemplate x:Key="ItemListTemplate"   >
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Path=ThumbnailFile}" Height="20" Width="20"/>
                <TextBlock Text="{Binding Name}"/>
            </StackPanel>
        </HierarchicalDataTemplate>
        <DataTemplate x:Key="EditItemListTemplate">
            <StackPanel Orientation="Horizontal" Background="Green">
                <Image Source="{Binding Path=ThumbnailFile}" Height="20" Width="20"/>
                <TextBox Text="{Binding Name, Mode=TwoWay}"/>
            </StackPanel>
        </DataTemplate>
        <HierarchicalDataTemplate x:Key="NavListTemplate"
                                  ItemsSource="{Binding ItemLists}"
                                  ItemTemplate="{StaticResource ResourceKey=ItemListTemplate}"
                                  >
            <TextBlock Text="{Binding Name}" />
        </HierarchicalDataTemplate>
 
...
 
<telerik:RadPanelBar  ItemsSource="{Binding NavSections}"  ItemTemplate="{StaticResource ResourceKey=NavListTemplate}"
                              ExpandMode="Multiple" HorizontalAlignment="Stretch"   VerticalAlignment="Top"
                              SelectedItem="{Binding Path=SelectedItemList, Mode=TwoWay}"  Margin="1"
                              IsEditable="True" ItemEditTemplate="{StaticResource ResourceKey=EditItemListTemplate}">
            <telerikNavigation:RadContextMenu.ContextMenu>
                <telerikNavigation:RadContextMenu x:Name="ContextMenu" Opened="ContextMenu_Opened" ItemClick="ContextMenu_ItemClick">
                    <telerikNavigation:RadMenuItem Header="Rename"/>
                    <telerikNavigation:RadMenuItem Header="Delete"/>
                    <telerikNavigation:RadMenuItem Header="Select" FontWeight="Bold"/>
 
                </telerikNavigation:RadContextMenu>
            </telerikNavigation:RadContextMenu.ContextMenu>
 
        </telerik:RadPanelBar>

Will
Top achievements
Rank 1
 answered on 16 Aug 2012
10 answers
403 views
I am building multi-axes line graphs using the RADCartesianChart control.
If I fill in the control using XAML, I get PanZoomBars as expected.  See sample XAML below

<UserControl x:Class="TestTelerik.ChartViewUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:TestTelerik="clr-namespace:TestTelerik"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
<UserControl.DataContext>
<TestTelerik:ViewModel/>
</UserControl.DataContext>
<Grid>
<telerik:RadCartesianChart Name="Chart" Zoom="{Binding Path=Zoom, Mode=TwoWay}" PanOffset="{Binding Path=PanOffset, Mode=TwoWay}">
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:LinearAxis Name="Time" Title="Time (sec)"/>
</telerik:RadCartesianChart.HorizontalAxis>


<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Name="Speed" Title="Speed (km/h)"/>
</telerik:RadCartesianChart.VerticalAxis>


<telerik:RadCartesianChart.Behaviors>
<telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both"/>
<telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" ShowTrackInfo="False"/>
</telerik:RadCartesianChart.Behaviors>

<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="vCar" XValueBinding="Time" Stroke="Black" DisplayName="vCar"/>
<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="sLap" XValueBinding="Time" Stroke="Blue">
<telerik:ScatterLineSeries.VerticalAxis>
<telerik:LinearAxis Name="sLap" Title="Distance (m)"/>
</telerik:ScatterLineSeries.VerticalAxis>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries ItemsSource="{Binding Data}" YValueBinding="ETyreTotalFL" XValueBinding="Time" Stroke="Red">
<telerik:ScatterLineSeries.VerticalAxis>
<telerik:LinearAxis Name="ETyreTotalFL" Title="Energy (kJ)"/>
</telerik:ScatterLineSeries.VerticalAxis>
</telerik:ScatterLineSeries>


<telerik:RadCartesianChart.Grid>
<telerik:CartesianChartGrid MajorLinesVisibility="XY"  />
</telerik:RadCartesianChart.Grid>


</telerik:RadCartesianChart>
</Grid>
</UserControl>

If I attempt the same thing in code, then the graphs appear correctly, but the PanZoomBars are missing! 
Code extract from a user control code behind file showing how I am filling in the control is shown below  (NOTE chart is a RadCartesianChart control specified in XAML of the UserControl).  

private void UpdateFromCollection()
{
if ((XAxes != null) && XAxes.Any() && (YAxes != null) && YAxes.Any())
{
var xAxis = XAxes.First();
this.Chart.HorizontalAxis = new LinearAxis
                            {Name = xAxis.Name, Title = string.Format("{0} ({1})", xAxis.Name, xAxis.Units)};


this.Chart.Behaviors.Clear();
var panAndZoomBehavior = new ChartPanAndZoomBehavior();
panAndZoomBehavior.ZoomMode = ChartPanZoomMode.Both;
panAndZoomBehavior.PanMode = ChartPanZoomMode.Both;
this.Chart.Behaviors.Add(panAndZoomBehavior);


var trackBallBehaviour = new ChartTrackBallBehavior();
trackBallBehaviour.ShowIntersectionPoints = true;
trackBallBehaviour.ShowTrackInfo = false;
this.Chart.Behaviors.Add(trackBallBehaviour);


this.Chart.Series.Clear();
bool firstYAxis = true;
foreach (var yAxis in YAxes)
{
var scatterLineSeries = new ScatterLineSeries {DisplayName = yAxis.Name};
scatterLineSeries.Stroke = new SolidColorBrush(yAxis.Colour);

for (var i = 0; i < xAxis.Data.Count; i++)
{
var sp = new ScatterDataPoint { XValue = xAxis.Data[i], YValue = yAxis.Data[i] };
scatterLineSeries.DataPoints.Add(sp);
}
if (firstYAxis)
{
this.Chart.VerticalAxis = new LinearAxis() { Name = yAxis.Name, Title = string.Format("{0} ({1})", yAxis.Name, yAxis.Units) };
firstYAxis = false;
}
else
{
scatterLineSeries.VerticalAxis = new LinearAxis() { Name = yAxis.Name, Title = string.Format("{0} ({1})", yAxis.Name, yAxis.Units) };
}
this.Chart.Series.Add(scatterLineSeries);
}
}
}


Is there something else I have to specify in order to get the PanZoomBars included?

Regards
Craig Littlewood





Ves
Telerik team
 answered on 16 Aug 2012
7 answers
152 views
Hi all,

I am using a custom min/max value for my x-axis (mainly to simulate the live data feel by scrolling the x-axis on every data update). However, it seems that when I run for the graph for a long period of time, the data points that should be out of the graph display range are being displayed on the edge of the graph instead of being omitted completely. Attached is a screenshot of the issue. 

I read somewhere else that this is a known issue. If so, are there any workarounds for omitting the data that won't fit in the current x-axis?

Furthermore, I also tried the workaround of having two separate data sets (one for storing all past values and another for holding the actual displayed data, which is a subset of the previous). However, when I change the ItemsSource from one to the other, the graph displays some strange behavior (erratic line drawings, etc.), which is why I am hoping to find a workaround without having to switch my data source.

Thanks,
Jin
Yavor
Telerik team
 answered on 16 Aug 2012
3 answers
193 views
Hi,
Is it possible to get the X and Y values of the point, where user right clicked on the Stacked Area to open the context Menu?
Or any nearby DataPoint  X,Y Values.

Please Reply as soon as possible.

Thanks in Advance.
Petar Kirov
Telerik team
 answered on 16 Aug 2012
2 answers
329 views

Hello,

I am looking for some sample code for raddiagramcontrols loading asynchronously using a background worker. Please share if you have any

Francois Vanderseypen
Top achievements
Rank 2
 answered on 16 Aug 2012
1 answer
167 views
Hello,

I need to hide minimize and maximize buttons in my radwindow.
I used your example on http://www.telerik.com/community/forums/wpf/window/window-style-and-template.aspx and modified ControlTemplate to hide the buttons, its works fine.
But I use a Style Manager in my Application
            StyleManager.ApplicationTheme = new Expression_DarkTheme();

After adding the ControlTemplate I can't style Radwindow header anymore.
Can you please help me ?









Lancelot
Top achievements
Rank 1
 answered on 15 Aug 2012
3 answers
510 views
i need 2 clarification

1.


i need to give notification using popup window instead of alert. is there any control to implement popup.

2.

i am having a Business Object Named Customer. i am binding the customer collection to RadGridView. i need to add the new row on top of the gridview. i have given the code

<Grid>
       <telerik:RadGridView AutoGenerateColumns="False" EditTriggers="F2" HorizontalAlignment="Left" Name="rgrdCustomer" RowIndicatorVisibility="Visible" VerticalAlignment="Top" AddingNewDataItem="rgrdCustomer_AddingNewDataItem" Deleting="rgrdCustomer_Deleting" RowEditEnded="rgrdCustomer_RowEditEnded" RowValidating="rgrdCustomer_RowValidating" ActionOnLostFocus="CancelEdit">
           <telerik:RadGridView.Columns>
               <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}" Header="ID" IsReadOnly="True" Width="50" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerName}" Header="CustomerName*" Width="250" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding OpeningBalance}" Header="OpeningBalance" DataFormatString="{} {0:##,##,##0.00}" Width="100" TextAlignment="Right" IsResizable="False" IsFilterable="False" IsGroupable="False" />
               <telerik:GridViewDataColumn DataMemberBinding="{Binding ContactNumber}" Header="ContactNumber" Width="100" IsResizable="False" IsFilterable="False" IsGroupable="False" />
 
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>
   </Grid>

class CustomerBO
   {
 
       #region Fields
               
       private int _CustomerID;
       private string _CustomerName;
       private decimal _OpeningBalance;
       private string _ContactNumber;
 
       #endregion
 
       #region Properties
 
       public int CustomerID
       {
           get { return _CustomerID; }
           set { _CustomerID = value; }
       }       
 
       public string CustomerName
       {
           get { return _CustomerName; }
           set { _CustomerName = value; }
       }       
 
       public decimal OpeningBalance
       {
           get { return _OpeningBalance; }
           set { _OpeningBalance = value; }
       }
 
 
       public string ContactNumber
       {
           get { return _ContactNumber; }
           set { _ContactNumber = value; }
       }
 
       #endregion
 
   }

public partial class CustomerView : UserControl
 {
     public CustomerView()
     {
         InitializeComponent();
     }
 
     private void rgrdCustomer_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
     {
         e.NewObject = new CustomerBO();
     }
 
     private void rgrdCustomer_Deleting(object sender, Telerik.Windows.Controls.GridViewDeletingEventArgs e)
     {
         CustomerDAL customerdata = new CustomerDAL();
 
         if (e.Items.Count() != 1)
         {
             Notification.ErrorMessage("More than one Customer Selected");
         }
 
         else
         {
             foreach (CustomerBO customer in e.Items)
             {
                 customerdata.Delete(customer.CustomerID);
                 Notification.InformationMessage("Deleted Sucessfully");
             }
         }
     }
 
     private void rgrdCustomer_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
     {
         if (e.EditAction == GridViewEditAction.Cancel)
         {
             return;
         }
 
         try
         {
             if (e.EditOperationType == GridViewEditOperationType.Insert)
             {
                 CustomerDAL customerdata = new CustomerDAL();
                 CustomerBO customerentity = (CustomerBO)e.NewData;
                 customerdata.Insert(customerentity);
                 this.LoadData();
                 Notification.InformationMessage("Added Successfully");
             }
 
             if (e.EditOperationType == GridViewEditOperationType.Edit)
             {
                 CustomerDAL customerdata = new CustomerDAL();
                 customerdata.Update((CustomerBO)e.NewData);
                 Notification.InformationMessage("Updated Successfully");
             }
             this.LoadData();
         }
         catch (Exception ex)
         {
             Notification.ErrorMessage(ex.Message);
         }
     }
 
     private void rgrdCustomer_RowValidating(object sender, Telerik.Windows.Controls.GridViewRowValidatingEventArgs e)
     {
 
         CustomerBO customer = e.Row.DataContext as CustomerBO;
 
         if (String.IsNullOrEmpty(customer.CustomerName) || customer.CustomerName.Length > 50)
         {
             RowValidation.Validate("CustomerName", "Fill the Customer Name", e);
         }
 
     }
 
     private void UserControl_Loaded(object sender, RoutedEventArgs e)
     {
         this.LoadData();
         this.rgrdCustomer.Focus();
     }
 
     private void LoadData()
     {
         CustomerDAL customerdata = new CustomerDAL();
         this.rgrdCustomer.ItemsSource = customerdata.FetchAll();
     }
 
      
 }

Dimitrina
Telerik team
 answered on 15 Aug 2012
2 answers
108 views
We used to have an license for the Telerik controls, but unfortunately it has lapsed.  And due to our budget, we're not likely to renew it.  Recently I made some modifications to one of the WPF apps I wrote, to use the Telerik controls we do have.  The latest version we have was 2011 Q2 or Q3.  In my development I've encountered a problem with the IsTabStop property on the Telerik DateTimePicker control; as in it doesn't work at all, if I set the IsTabStop to False.  And looking into it, it appears to me that it was a known bug back then.

So my question is, has this bug been fixed in the current versions of the Telerik controls, especially for WPF?  We may not be able to renew our licenses, but if this bug has been fixed then that at least gives me more support in my effort to try and get our Telerik licenses renewed.  If on the other hand, it hasn't been fixed, then I'd like to know about that, too.  As it is, right now I'm planning on working with what we've got, and having to rethink our UI design and behavior, based upon this bug's behavior.
Rod
Top achievements
Rank 1
 answered on 15 Aug 2012
2 answers
196 views
I have a RadDataForm on which some DataFormDataField fields seemed to be read-only.

Using Snoop, I discovered that the form's mode is ReadOnly.

Now here's the thing.  I had AutoEdit="True" in the xaml.  I've tried setting AutoEdit and calling BeginEdit() in the constructor, and in DataContextChanged, both, and neither seems to make any difference.  Both in the constructor and in DataContextChanged, CanBeginEdit is false.

What could be going on that would cause CanBeginEdit to be false?

The form is bound to its DataContext, via CurrentItem="{Binding Path=.}"

Ivan Ivanov
Telerik team
 answered on 15 Aug 2012
1 answer
87 views
Hallo,

is it possible to mix autogenerated properties with customized properties in one property grid?


best regards
Ivan Ivanov
Telerik team
 answered on 15 Aug 2012
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?