hai
I am creating a user control with datagrid and i created a property called DataGridNumeric column and I want to add this property for my control.
Please he me hos to do this.
I use this code for creating column collection
public Collection<DataGridColumn> field = new Collection<DataGridColumn>();
[Category("Data")]
[Description("New Column Creation")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Collection<DataGridColumn> Columns
{
get { return field; }
}
Thanks.
Dear Telerik Support
I just started using your controls for WPF, to see if it suits the needs of our company
Starting by doing basic examples, I stumbled upon the RadGridView pagination
I am trying to use this example
http://demos.telerik.com/silverlight/#DomainDataSource/MVVM and
and this documentation
http://docs.telerik.com/devtools/wpf/controls/raddatapager/getting-started#adding-raddatapager
But it seems my grid wont page if I dont use this
this.view = new QueryableDomainServiceCollectionView<Customer>(context, getCustomersQuery);
this.view.PageSize = 10;
thus attributing the PageSize to it.
right now I use a ObservableCollection<Entity> List.
So my question is: Where how can I use the above mentioned class (QueryableDomainServiceCollectionView) to support my need of pagination?
I don't want to paginate it manually, by using the Unbound mode. and I would prefer to avoid that all data goes into memory
I wish I could attach a zip file of my project. but since I cannot, here is the code (note: you must install the PropertyChanged.Fody nugget in order to run it):
XAML
<Window x:Class="TelerikWpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:TelerikWpfApp1"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid Name="grid">
<Grid.DataContext>
<local:ViewModel/>
</Grid.DataContext>
<telerik:RadGridView x:Name="radGridView"
HorizontalAlignment="Left"
Margin="23,30,0,0" VerticalAlignment="Top"
Height="234" Width="468"
ItemsSource="{Binding List}" AutoGenerateColumns="True">
<telerik:RadGridView.Columns>
<telerik:GridViewColumn BindingGroup="{Binding id}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadDataPager x:Name="radDataPager"
Margin="23,264,26,27"
PageSize="5"
DisplayMode="PreviousNext"
Source="{Binding List, ElementName=radGridView}" />
</Grid>
</Window>
XAML.CS
using System.Windows;
namespace TelerikWpfApp1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
ViewModel vm = null;
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
vm = grid.DataContext as ViewModel;
vm.Load();
}
}
VIEWMODEL.cs
using PropertyChanged;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace TelerikWpfApp1
{
[ImplementPropertyChanged]
public class ViewModel
{
public ObservableCollection<Entity> List { get; set; }
public void Load()
{
List = GetList().ToObservableCollection();
}
List<Entity> GetList()
{
List<Entity> list = new List<Entity>();
for (int i = 0; i < 100; i++)
{
list.Add(new Entity() { comment = "dasd", id = 1, name = "fefe" });
list.Add(new Entity() { comment = "xxcv", id = 2, name = "dewd" });
list.Add(new Entity() { comment = "zzz", id = 3, name = "jjj" });
}
return list;
}
//public void Save(Entity item, string comment)
//{
// if (item.comment != comment)
// {
// //controller.Save(); }
// }
//}
}
public class Entity
{
public int id { get; set; }
public string name { get; set; }
public string comment { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
public static class ListExtensions
{
public static ObservableCollection<T> ToObservableCollection<T>(this IEnumerable<T> items)
{
var c = new ObservableCollection<T>();
foreach (var item in items)
{
c.Add(item);
}
return c;
}
}
}
Thank you!!!!
I am working through your documentation and am trying to get the 2nd TimeSpanPicker working.
<telerik:RadTimeSpanPicker x:Name="Duration" Value="{Binding SelectedDuration, Mode=TwoWay}"...
My implementation (different source & different name):
<telerik:RadTimeSpanPicker Grid.Row="1" x:Name="Duration" Value="{Binding SelectedDuration, Mode=TwoWay}" StringFormat="hh\:mm' hours'" TimeSpanWatermarkContent="Select duration..."> <telerik:RadTimeSpanPicker.TimeSpanComponents> <wpf:TimeSpanDurationComponent ItemsSource="{Binding Durations, Mode=OneWayToSource}" Header="Minutes"/> </telerik:RadTimeSpanPicker.TimeSpanComponents></telerik:RadTimeSpanPicker>I added the DurationTimeSpanComponent (wpf.TimeSpanDurationComponent) and have the Durations collection on my MV.
However, I get this error during runtime:
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Durations; DataItem=null; target element is 'TimeSpanDurationComponent' (HashCode=46098163); target property is 'ItemsSource' (type 'IEnumerable')
Your example includes that control is a container. Is that important?
What I see is that you include a namespace that doesn't seem to be part of my install. When I attempt to set this xmlns I don't have it as an option. And, when I go to add a reference this is not part listed. Is the documentation bad? Is this QuickStart namespace supposed to be part of most common implementations?
xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=QuickStart.Common"
Dear Telerik Support
I just started using your controls for WPF, to see if it suits the needs of our company
Starting by doing basic examples, I stumbled upon the RadGridView pagination
I am trying to use this example
http://demos.telerik.com/silverlight/#DomainDataSource/MVVM and
and this documentation
http://docs.telerik.com/devtools/wpf/controls/raddatapager/getting-started#adding-raddatapager
But it seems my grid wont page if I dont use this
this.view = new QueryableDomainServiceCollectionView<Customer>(context, getCustomersQuery);
this.view.PageSize = 10;
thus attributing the PageSize to it.
right now I use a ObservableCollection<Entity> List.
So my question is: Where how can I use the above mentioned class (QueryableDomainServiceCollectionView) to support my need of pagination?
I don't want to paginate it manually, by using the Unbound mode. and I would prefer to avoid that all data goes into memory
I will attach the code of my sample project here. Not you must install the PropertyChanged.Fody in order to run it.
<t:RadGridView x:Name="Logs"> <t:RadGridView.Columns> <t:GridViewDataColumn CellTemplateSelector="{StaticResource IconTemplateSelector}" /> <t:GridViewDataColumn DataMemberBinding="{Binding LogLevel,Mode=OneWay}" Header="Level" CellStyle="{StaticResource PaddedCell}"/> <t:GridViewDataColumn DataMemberBinding="{Binding LogID,Mode=OneWay}" Header="LogID"/> <t:GridViewDataColumn DataMemberBinding="{Binding MachineDateTime,Mode=OneWay}" Header="Machine Time" CellStyle="{StaticResource PaddedCell}"/> <t:GridViewDataColumn DataMemberBinding="{Binding Occured, Mode=OneWay}" Header="Occured" CellStyleSelector="{StaticResource ColorSelector}"/> <t:GridViewDataColumn DataMemberBinding="{Binding System,Mode=OneWay}" Header="System" CellStyle="{StaticResource PaddedCell}" /> <t:GridViewDataColumn DataMemberBinding="{Binding Mode,Mode=OneWay}" Header="Mode" CellStyle="{StaticResource PaddedCell}" /> <t:GridViewDataColumn DataMemberBinding="{Binding CallingClass,Mode=OneWay}" Header="Calling Class" CellStyle="{StaticResource PaddedCell}" /> <t:GridViewDataColumn DataMemberBinding="{Binding Message,Mode=OneWay}" Header="Message" CellStyle="{StaticResource PaddedCell}" /> <t:GridViewDataColumn DataMemberBinding="{Binding Exception,Mode=OneWay}" Header="Exception" CellStyle="{StaticResource PaddedCell}" /> </t:RadGridView.Columns> </telerik:RadGridView>
I have above data-bound RadGridView (named Logs) and I am trying to export its contents, but it always results into an empty exported file.
And I try to export the contents of RadGridView with below code:
private void ExportLogs(){ using (var stream = File.Create(filepath)) { Logs.Export(stream, new GridViewExportOptions() { Format = ExportFormat.ExcelML, ShowColumnHeaders = true, ShowColumnFooters = false, ShowGroupFooters = false, }); } }Hello
Why this doesn't work?
It causes the following exception:
An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.FixedDocumentViewers.dll
em Telerik.Windows.Controls.FixedDocumentViewerBase.AttachToDocumentEvents(RadFixedDocument document)em Telerik.Windows.Controls.FixedDocumentViewerBase.OnDocumentChanged(RadFixedDocument oldValue, RadFixedDocument newValue)em Telerik.Windows.Controls.FixedDocumentViewerBase.<.cctor>b__1(DependencyObject s, DependencyPropertyChangedEventArgs e)em System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)em System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)em System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

I Would like to bind title/header beginning of each line of chart from data source.I already binded with required display with legend and it is working fine but i need help to display at beginging of each line series.Please help it..please refer image...
<telerik:RadCartesianChart.SeriesProvider>
<telerik:ChartSeriesProvider Source="{Binding Data}">
<telerik:ChartSeriesProvider.SeriesDescriptors>
<telerik:CategoricalSeriesDescriptor ItemsSourcePath="LineData" ValuePath="Value" CategoryPath="Vector" >
<telerik:CategoricalSeriesDescriptor.Style>
<Style TargetType="telerik:StepLineSeries">
<Setter Property="StrokeThickness" Value="2"/>
<Setter Property="ShowLabels" Value="False"/>
<Setter Property="PointTemplate" Value="{StaticResource LinePointTemplate}"/>
<Setter Property="LegendSettings">
<Setter.Value>
<telerik:SeriesLegendSettings x:Name="l" Title="{Binding Name}"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalAxis">
<Setter.Value>
<telerik:LinearAxis Title="{Binding Name}" LabelTemplate="{StaticResource YLabelTemplate}"
/>
</Setter.Value>
</Setter>
</Style>
</telerik:CategoricalSeriesDescriptor.Style>
</telerik:CategoricalSeriesDescriptor>
</telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>
VM .. { ..public ObservableCollection<Item> Data { get; set; } Data.Add(new WaveFormItem() { Name = "105.1", LineData = new ObservableCollection<LineDataModel>() { new WaveFormLineData() { Vector = 0, Value = 1.0 }, new WaveFormLineData() { Vector = 1, Value = 1.1 } } });} public class LineDataModel { public int Vector { get; set; } public double Value { get; set; } } public class Item { public string Name { get; set; } public ObservableCollection<LineDataModel> LineData { get; set; } }I'm working on a chart that had a bunch of series as bars. I'm wanting to change one from a bar to a bubble series and when the chart goes to display I get an error in Telerik code with the exception: "Width and Height must be non-negative".
The stack trace is in the attached PNG file ("Tracker" is my app).
