Dear Support,
I'm very new with Telerik and I'm evaluating WPF Diagram in a new project for
one of our most important customer.
One of Custom Shape we have to build must implement the function to add Connectors (for example by a Context Menu acttivated command).
The Shape has a linear aspect and adding commands are "Add connector on the Right" and "Add connector on the Left".
Both adding methods recalculate Offset of exixsting connectors and then add a new connector, with the aim to have connectors regularly spaced along the Shape.
Although I can see new connector and existing ones in the Shape Connectors List, the aspect of the rendered Shape does not change that is to say that I cannot see the new connector and exixsting ones do not change their position.
Those commands ​must operate (change Offset) also on Connectors with Connections, so for now I discarded the way of Remove and Add Connectors in order to avoid to loose existing Connection.
Where's my error?
Thank you
King Regards
Domenico
<Window x:Class="RadPivotGrid_GettingStarted.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:local="clr-namespace:WpfApplication1.RadPivotGrid_GettingStarted" xmlns:pivot="http://schemas.telerik.com/2008/xaml/presentation/pivot" Title="MainWindow" Height="350" Width="525" > <Window.Resources> <pivot:LocalDataSourceProvider x:Key="LocalDataProvider" AggregatesPosition="Rows"> <pivot:LocalDataSourceProvider.RowGroupDescriptions> <pivot:PropertyGroupDescription PropertyName="Name" /> </pivot:LocalDataSourceProvider.RowGroupDescriptions> <pivot:LocalDataSourceProvider.ColumnGroupDescriptions> <pivot:DateTimeGroupDescription PropertyName="Date" Step="Month" /> </pivot:LocalDataSourceProvider.ColumnGroupDescriptions> <pivot:LocalDataSourceProvider.AggregateDescriptions> <pivot:PropertyAggregateDescription PropertyName="Price" StringFormat="C" AggregateFunction="Average" /> <pivot:PropertyAggregateDescription PropertyName="Quantity"/> </pivot:LocalDataSourceProvider.AggregateDescriptions> </pivot:LocalDataSourceProvider> </Window.Resources> <Grid> <pivot:RadPivotGrid Name="radPivotGrid1" DataProvider="{StaticResource LocalDataProvider}" > </pivot:RadPivotGrid> </Grid></Window>Imports SystemImports System.Collections.GenericImports System.WindowsImports Telerik.Pivot.CoreNamespace RadPivotGrid_GettingStartedPublic Class Product Public Property Name() As String Get Return m_Name End Get Set(ByVal value As String) m_Name = value End Set End Property Private m_Name As String Public Property Quantity() As Integer Get Return m_Quantity End Get Set(ByVal value As Integer) m_Quantity = value End Set End Property Private m_Quantity As Integer Public Property Price() As Double Get Return m_Price End Get Set(ByVal value As Double) m_Price = value End Set End Property Private m_Price As Double Public Property [Date]() As DateTime Get Return m_Date End Get Set(ByVal value As DateTime) m_Date = value End Set End Property Private m_Date As DateTime End Class Partial Public Class MainWindow Public Sub New() InitializeComponent() Try TryCast(Me.Resources("LocalDataProvider"), LocalDataSourceProvider).ItemsSource = GeneratePivotData() Catch ex As Exception End Try End Sub Private Shared Function GeneratePivotData() As IList(Of Product) Dim PivotData As IList(Of Product) = New List(Of Product)() From { _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _ .Price = 10.4, _ .Quantity = 148 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _ .Price = 10.99, _ .Quantity = 122 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _ .Price = 11.24, _ .Quantity = 80 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _ .Price = 11.24, _ .Quantity = 90 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _ .Price = 11.14, _ .Quantity = 140 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _ .Price = 10.89, _ .Quantity = 162 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _ .Price = 10.89, _ .Quantity = 181 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _ .Price = 10.88, _ .Quantity = 180 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _ .Price = 11.0, _ .Quantity = 116 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _ .Price = 10.99, _ .Quantity = 128 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _ .Price = 10.95, _ .Quantity = 145 _ }, _ New Product() With { _ .Name = "Pen", _ .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _ .Price = 10.45, _ .Quantity = 189 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _ .Price = 5.22, _ .Quantity = 100 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _ .Price = 5.99, _ .Quantity = 85 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _ .Price = 6.04, _ .Quantity = 80 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _ .Price = 6.28, _ .Quantity = 72 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _ .Price = 6.12, _ .Quantity = 99 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _ .Price = 6.59, _ .Quantity = 40 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _ .Price = 6.29, _ .Quantity = 68 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _ .Price = 5.99, _ .Quantity = 95 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _ .Price = 5.89, _ .Quantity = 120 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _ .Price = 5.99, _ .Quantity = 105 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _ .Price = 5.96, _ .Quantity = 111 _ }, _ New Product() With { _ .Name = "Pencil", _ .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _ .Price = 5.99, _ .Quantity = 108 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 1, 1, 0, 0, 0), _ .Price = 22.86, _ .Quantity = 88 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 2, 1, 0, 0, 0), _ .Price = 23.02, _ .Quantity = 95 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 3, 1, 0, 0, 0), _ .Price = 23.22, _ .Quantity = 102 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 4, 1, 0, 0, 0), _ .Price = 21.99, _ .Quantity = 95 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 5, 1, 0, 0, 0), _ .Price = 22.45, _ .Quantity = 84 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 6, 1, 0, 0, 0), _ .Price = 22.56, _ .Quantity = 96 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 7, 1, 0, 0, 0), _ .Price = 22.88, _ .Quantity = 88 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 8, 1, 0, 0, 0), _ .Price = 22.42, _ .Quantity = 99 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 9, 1, 0, 0, 0), _ .Price = 22.56, _ .Quantity = 111 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 10, 1, 0, 0, 0), _ .Price = 22.18, _ .Quantity = 102 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 11, 1, 0, 0, 0), _ .Price = 22.93, _ .Quantity = 105 _ }, _ New Product() With { _ .Name = "Notebook", _ .[Date] = New DateTime(2012, 12, 1, 0, 0, 0), _ .Price = 22.89, _ .Quantity = 122 _ } _ } Return PivotData End Function End ClassEnd NamespaceHi,
I Use radgridview with virtualization (not paging) to show data.
I want to put a busy indicator on my rad grid view that will not freeze the whole grid when loading , as the facebook / gmail apps.
When i Use radbusyindicator as the parent of the grid or use the is busy property , the grid freeze while loading.
Thank you
Hi,
following the demo I've created an attached property to my RadGridView that adds a column that displays the number of the row.
Everything works fine, but if my grid has a group descriptor defined in xaml or loaded from the custom settings saved by the user, then the numbers appear not sorted.
It seems like the numeration happens before the grouping, but I don't know how to fix it.
Here's my code:
public class RowNumeratorBehavior
{
public static bool GetRowNumerator(RadGridView grid)
{
return (bool)grid.GetValue(RowNumeratorProperty);
}
public static void SetRowNumerator(RadGridView grid, bool value)
{
grid.SetValue(RowNumeratorProperty, value);
}
public static readonly DependencyProperty RowNumeratorProperty =
DependencyProperty.RegisterAttached("RowNumerator", typeof(bool), typeof(RowNumeratorBehavior), new UIPropertyMetadata(OnAutoSelectedChanged));
static void OnAutoSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
RadGridView source = (sender as RadGridView);
if (source == null) return;
if ((bool)e.NewValue)
{
source.DataContextChanged += source_DataContextChanged;
Telerik.Windows.Persistence.Services.ServiceProvider.RegisterPersistenceProvider<Telerik.Windows.Persistence.Services.ICustomPropertyProvider>(typeof(RadGridView), new GridViewCustomPropertyProvider());
}
else
{
source.DataContextChanged -= source_DataContextChanged;
}
}
private static void source_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
RadGridView source = (sender as RadGridView);
var numerator = new RowNumberColumn();
numerator.Header = "";
numerator.Name = "Numerator";
numerator.UniqueName = "Numerator";
numerator.IsReorderable = false;
numerator.Background = System.Windows.Media.Brushes.White;
source.Columns.Insert(0,numerator);
}
}
public class RowNumberColumn : Telerik.Windows.Controls.GridViewDataColumn
{
public override System.Windows.FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)
{
TextBlock textBlock = cell.Content as TextBlock;
if (textBlock == null)
{
textBlock = new TextBlock();
}
textBlock.Text = ((this.DataControl.ItemsSource as IList).IndexOf(dataItem) + 1).ToString();
return textBlock;
}
protected override void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args)
{
base.OnPropertyChanged(args);
if (args.PropertyName == "DataControl")
{
if (this.DataControl != null && this.DataControl.Items != null)
{
this.DataControl.Items.CollectionChanged += (s, e) =>
{
if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
{
this.Refresh();
}
};
}
}
}
}
Thanks in advance,
Matteo
We are using implicit styles like this:
<ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml"/> <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/> ... <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.GridView.xaml"/> ... ...</ResourceDictionary.MergedDictionaries>Now we want just one control (GridView) to be displayed with another theme (Windows8). What is the most efficient and easiest way to display all GridViews in our application (and there are a lot of them) with the design of the Windows8-theme?
TIA
Neils
[Import] [SuppressMessage("Microsoft.Design", "CA1044:PropertiesShouldNotBeWriteOnly", Justification = "Needs to be a property to be composed by MEF")] SampleViewModel ViewModel { set { this.DataContext = value; } } hi
i have problem with clippanel
i want to use one color for part 1 and 2 in photo
i want my background chart is one color
my code use two way but nothing help me
01.<Style x:Key="ClipPanelStyle"02.TargetType="telerik:ClipPanel">03. <Setter Property="Background">04. <Setter.Value>05. <SolidColorBrush Color="#096bb3"></SolidColorBrush>06. <!--<LinearGradientBrush EndPoint="1,0"07. StartPoint="0,1"08. SpreadMethod="Pad">09. <GradientStop Color="Black"10. Offset="0" />11. <GradientStop Color="#FF00B4FF"12. Offset="1" />13. </LinearGradientBrush>-->14. </Setter.Value>15. </Setter>16. </Style>i want part 1 and 2 be one color not be two color
Hi,
I have a combobox that has the ItemsSource bound to an
observablecollection of Priority objects. Priority objects have and ID
and a Description.
My combobox is in a DataTemplate for a listBoxItem that is bound to
another collection of objects. Filter objects, which have a
FilterPriorityID property
I set the combobox.DisplayMemberPath="Description" which seems fine.
I set the SelectedValuePath="{Binding FilterPriorityID}" expecting
the combobox to auto select the correct Priority using the
FilterPriorityID. but this is not the case.
Seems i am missing something, coming from Winforms.
Gary
<telerik:RadComboBox ItemsSource="{Binding Path=DataContext.EventFilterPriorites, RelativeSource={RelativeSource AncestorType=UserControl}}" SelectedValuePath="{Binding Path=EventFilterPriorityID}" DisplayMemberPath="Description" VerticalAlignment="Top" HorizontalAlignment="Left" Height="25" Margin="3" Width="100"/>I am using RadTab Control and one of the tab item host a Rad Schedule view, I have a event handler for calendar loaded event.
I want the event to be called only for the first time the tab is loaded, for that i have set IscontentPreserved = true for the tab control, but still the loaded event gets called every time.
Vikas
