Hi,
I have an application using the telerik docking-framework and timelines. I have an issue when undocking a frame containing a RadTimeline.
I get a NullPointerException in Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.RemoveDummyItem.
It turns out I only get the exception when I have the Intervals property set. If I remove the Intervals it does not crash.
I have another dockpanel with a RadTimeline as well, but that one does not generate the NullPointerException, so maybe I am doing something bad.
My RadTimeline xaml which crashes looks like this:
<
telerik:RadTimeline
MinHeight
=
"55"
Margin
=
"2"
AutoSort
=
"False"
DurationPath
=
"Duration"
GroupExpandMode
=
"None"
ItemsSource
=
"{Binding TimePeriods}"
PeriodEnd
=
"{Binding VisiblePeriodEnd, Mode=OneWay}"
PeriodHeaderStyle
=
"{StaticResource PeriodHeaderStyle}"
PeriodStart
=
"{Binding VisiblePeriodStart, Mode=OneWay}"
ScrollMode
=
"None"
SnapsToDevicePixels
=
"True"
StartPath
=
"Start"
TimelineItemTemplate
=
"{StaticResource ItemTemplate}"
VerticalScrollBarVisibility
=
"Hidden"
VisiblePeriodEnd
=
"{Binding VisiblePeriodEnd, Mode=OneWay}"
VisiblePeriodStart
=
"{Binding VisiblePeriodStart, Mode=OneWay}"
>
<
telerik:RadTimeline.Intervals
>
<
telerik:DayInterval
FormatterProvider
=
"{StaticResource DayFormatterProvider}"
/>
</
telerik:RadTimeline.Intervals
>
</
telerik:RadTimeline
>
Here is the callstack:
An unhandled exception of type 'System.NullReferenceException' occurred in Telerik.Windows.Controls.DataVisualization.dll
Objektreferensen har inte angetts till en instans av ett objekt.
Ohanterat undantag: System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt.
vid Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.RemoveDummyItem()
vid Telerik.Windows.Controls.TimeBar.TimeIntervalContainerBase.MeasureIntervalFormats()
vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
vid System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
vid System.Windows.Threading.DispatcherOperation.InvokeImpl()
vid MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
vid MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
vid System.Windows.Threading.DispatcherOperation.Invoke()
vid System.Windows.Threading.Dispatcher.ProcessQueue()
vid System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
vid MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
vid MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
vid System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
vid System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
vid System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
vid MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
vid MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
vid System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
vid System.Windows.Application.RunDispatcher(Object ignore)
vid System.Windows.Application.RunInternal(Window window)
Do you have any clue what is causing the issue?
Best regards
/Ola Nygren
Greetings,
I am currently working with a RadCartesianChart and I was wondering if it was possible to display a ScatterPointSeries with a CandleSticks instead of it's current data-point. After reading the online documentation, I found out that I cannot use a CandlesticSeries since it requires a categorical axis for the X axis. Would it be doable to create a ScatterCandlesticSeries with the Telerik library?
Thank you and have a great day,
François
I am trying to override the default behaviour for copy to clipboard from the PDF control when invoked from the keyboard.
I've created a class derived from FixedDocumentViewerCommandBase to add my custom action and this works when invoked from the Telerik toolbar or default context menu but it doesn't get invoked from the keyboard shortcut Ctrl-C.
So I've tried calling KeyBindings.Clear and adding a new KeyBinding. At first, I thought this had not worked at all - the default copy to clipboard was executed when I selected some text. However, what actually seems to be going on is that the KeyBindings are reset to their defaults when Mode is switched to TextSelection.
Have I missed a trick here?
I've researched all morning how to modify the behavior of a RadGridView (in WPF) for moving focus from one control to the next, just like the Tab key does... and like many other examples I've seen, I want to do the same thing: just make the Enter Key mimic the Tab key. But my code is not working.
If I have the following code in XAML:
<telerik:GridViewDataColumn Name="MyColumn" CellStyleSelector="{DynamicResource MyColorStyle}" Width="64">
<telerik:GridViewDataColumn.Header>
<TextBlock Text="My Column" TextAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" />
</telerik:GridViewDataColumn.Header>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding MyNumber}" TextAlignment="Right"></TextBlock>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
<telerik:GridViewColumn.CellEditTemplate>
<DataTemplate>
<TextBox Name="MyNumberTextBox" Text="{Binding MyNumber, Mode=TwoWay}" IsTabStop="True" TabIndex="27" PreviewKeyDown="MyNumberTextBox_PreviewKeyDown" MaxLength="10" HorizontalAlignment="Stretch" VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</DataTemplate>
</telerik:GridViewColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
And I have this code in the code-behind:
private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if ((e.Key == Key.Enter) || (e.Key == Key.Return))
{
e.Handled = true;
(sender as TextBox).MoveFocus(new TraversalRequest(System.Windows.Input.FocusNavigationDirection.Next));
}
}
The focus does not advance to the next column immediately to the right on the RadGridView row; it instead advances back to the top of the screen (to a pulldown menu control). I have TabStops explicitly set for every textbox in my column(s).
Could use some help here to determine what I am not doing properly, or what I may be missing. Thanks in advance for your help.
I set FormatString="n0" on RadMaskedTextInput and it works great when adding new digits. But it doesnot update its textbox value on delete.
For example, I enter 1 000 000, it looks OK, but when I remove last digit it becomes 1 000 00 , and what we expect is 100 000
I attached a screenshot which shows how it looks like on change
Is there a workaround available to fix this?
Thanks
Best regards,
Vladimid
I'm trying to modify the default behavior for expanding and contracting groups in the grid. End users (gotta love them) are complaining that it's too easy to inadvertently hide or show a group by clicking anywhere in the GroupHeaderRow. They want the group to be expanded or contracted based on clicking the glyph arrow on the far left of the GroupHeaderRow. I know I'm going to need to edit the Control Template, but just wondering if I could save some time by asking for specifics on what needs to be edited.
Thanks all.
I want to repurpose the new item row to allow vertical editing of the grid, i.e. an edit in any cell of the new item row will be propagated down that column and the new item row's cell will be cleared after propagation to the other records.
I have tried not using the new row and just adding an empty row to the data source but it doesn't play nice with descending sorting, however, most other operations seem to work ok on the minimal testing I have done. I think the new item row might be the more robust approach though.
Thanks,
Maurice
Hello. I have a special classes: tbTechObject and tbTech. tbTechObject contains tbTech. When I use "full test search" it doesn`t work for column with tbTechObject items (telerik:GridViewComboBoxColumn "ТСИ"). "full test search" work only for string columns. What have I do to "full test search" searches in column with my custom type elements? Thanks.
[global::System.ComponentModel.TypeConverter(typeof(tbTechObjectConverter))]
public class tbTechObject : IEquatable<tbTechObject>, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void FirePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public int idTechObject { get; set; }
public ObservableCollection<tbTech> nameTech { get; set; }//Items source for combobox column in radgridview. This class describe bellow
private tbTech nTech;
public tbTech NTech
{
get { return nTech; }
set
{
if (this.nTech != value)
{
this.nTech = value;
FirePropertyChanged("NTech");
}
}
}
public string serialNum { get; set; }
public string inventNum { get; set; }
public void save()
{
//save to db
}
bool IEquatable<tbTechObject>.Equals(tbTechObject other)
{
if (other == null)
{
return false;
}
return StringComparer.Ordinal.Equals(this.NTech.name, other.NTech.name);
}
public override bool Equals(object obj)
{
return ((IEquatable<tbTechObject>)this).Equals(obj as tbTechObject);
}
public override int GetHashCode()
{
if (this.NTech == null)
this.NTech = this.nameTech[0];
return this.NTech.name.GetHashCode() ^ this.idTechObject.GetHashCode();
}
public override string ToString()
{
return this.NTech.name;
}
}
public class tbTechObjectConverter : System.ComponentModel.TypeConverter
{
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
var stringValue = value as string;
if (stringValue != null)
{
return new tbTechObject { idTechObject = -1 };
}
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(string))
{
return true;
}
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
return ((tbTechObject)value).ToString();
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
/////////////////////////////////
[global::System.ComponentModel.TypeConverter(typeof(tbTechConverter))]
public class tbTech : IEquatable<tbTech>, INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private void FirePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
public int idNameTech { get; set; }
public string name { get; set; }
public bool save()
{
//save to db
}
bool IEquatable<tbTech>.Equals(tbTech other)
{
if (other == null)
{
return false;
}
return StringComparer.Ordinal.Equals(this.name, other.name);
}
public override bool Equals(object obj)
{
return ((IEquatable<tbTech>)this).Equals(obj as tbTech);
}
public override int GetHashCode()
{
return this.name.GetHashCode() ^ this.idNameTech.GetHashCode();
}
public override string ToString()
{
return this.name;
}
}
public class tbTechConverter : System.ComponentModel.TypeConverter
{
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
var stringValue = value as string;
if (stringValue != null)
{
return new tbTech { name = stringValue, idNameTech = -1 };
}
return base.ConvertFrom(context, culture, value);
}
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(string))
{
return true;
}
return base.CanConvertTo(context, destinationType);
}
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
return ((tbTech)value).ToString();
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
//////////////////XAML
<telerik:RadGridView x:Name="mainDG" Margin="259,0,5,5" AutoGenerateColumns="False" CanUserDeleteRows="False" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" MouseDoubleClick="mDClikMainDG" MouseRightButtonDown="mouseRBtnDownMainDG" ScrollMode="Deferred" AutomationProperties.IsRowHeader="True">
<telerik:RadGridView.Columns>
<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" EditTriggers="CellClick" AutoSelectOnEdit="True">
<telerik:GridViewCheckBoxColumn.Header>
<CheckBox HorizontalAlignment="Center" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
</CheckBox>
</telerik:GridViewCheckBoxColumn.Header>
</telerik:GridViewCheckBoxColumn>
<telerik:GridViewComboBoxColumn Header="ТСИ" Width="200" EditTriggers="CellClick" ItemsSourceBinding="{Binding nameTech}" DisplayMemberPath="name" DataMemberBinding="{Binding NTech, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValueMemberPath="{Binding NTech, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsComboBoxEditable="True" IsFilterable="True">
</telerik:GridViewComboBoxColumn>
<telerik:GridViewDataColumn Header="Serial number" DataMemberBinding="{Binding serialNum}"/>
<telerik:GridViewDataColumn Header="Inventor number" DataMemberBinding="{Binding inventNum}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>