Telerik Forums
UI for WPF Forum
2 answers
1.1K+ views
Hi,

I am trying to add a RadSlider control to my application. It get build successfully but when I run the application I am getting an error.

An unhandled exception of type 'System.InvalidProgramException' occurred in Telerik.Windows.Controls.dll
Additional information: JIT Compiler encountered an internal limitation.


And here is the stack trace

   at Telerik.Windows.Controls.Primitives.LayoutTransformControl.get_Child()
   at Telerik.Windows.Controls.Primitives.LayoutTransformControl.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Window.MeasureOverrideHelper(Size constraint)
   at System.Windows.Window.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Window.SourceWindowHelper.set_RootVisual(Visual value)
   at System.Windows.Window.SetRootVisual()
   at System.Windows.Window.SetRootVisualAndUpdateSTC()
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.CreateSourceWindowDuringShow()
   at System.Windows.Window.SafeCreateWindowDuringShow()
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at BeamBox.NativeAppEmulator.App.Main() in l:\Repo\beambox\BeamBox.NativeAppEmulator\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()



Jared
Top achievements
Rank 1
 answered on 16 Nov 2014
1 answer
148 views
Hello!

I have problems whit ContextMenu inside a TextBox but, when I use the textbox inside a DataFormDataField the items doesn´t appears, just appears "Copy, Paste, Cut", the Textbox whit the contextmenu works perfect when is outside a DataForm, any idea?

Thanks in adnvace

Here some code:

<Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Styles.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Grid.Resources>
       <telerik:RadDataForm x:Name="DataForm">
            <telerik:RadDataForm.ReadOnlyTemplate>
                <DataTemplate>
                <TextBox x:Name="textBox"
         Width="200" ContextMenu="{x:Null}"
         VerticalAlignment="Top" Margin="141,125,176,0">
                    <telerik:RadContextMenu.ContextMenu>
                        <telerik:RadContextMenu x:Name="ContextMenuHugo" ItemContainerStyle="{StaticResource MenuItemContainer}" Opening="ContextMenuHugo_OnOpening">
                                                   
                        </telerik:RadContextMenu>
                    </telerik:RadContextMenu.ContextMenu>
         
        </TextBox>
        </DataTemplate>
        </telerik:RadDataForm.ReadOnlyTemplate>
        </telerik:RadDataForm>
        <TextBox x:Name="textBox"
         Width="200" ContextMenu="{x:Null}"
         VerticalAlignment="Top" Margin="141,125,176,0">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="ContextMenuHugo" ItemContainerStyle="{StaticResource MenuItemContainer}"
                                                >
 
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
 
        </TextBox>
    </Grid>

Cheers
Boris
Telerik team
 answered on 14 Nov 2014
1 answer
167 views
Hi

We have a problem with ContextMenu in a textbox when we try to use it inside a DataFormDataField, the items doesn't appears, just appear "Copy, Cut, Paste".
We did try populate the ItemsSource property from Opening Event and from a Binding, but doesn´t work
I attached a little example solution

And here some code, the textbox outside DataForm works perfect
<Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Styles.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Grid.Resources>
       <telerik:RadDataForm x:Name="DataForm">
            <telerik:RadDataForm.ReadOnlyTemplate>
                <DataTemplate>
                <TextBox x:Name="textBox"
         Width="200" ContextMenu="{x:Null}"
         VerticalAlignment="Top" Margin="141,125,176,0">
                    <telerik:RadContextMenu.ContextMenu>
                        <telerik:RadContextMenu x:Name="ContextMenuHugo" ItemContainerStyle="{StaticResource MenuItemContainer}" Opening="ContextMenuHugo_OnOpening">
                                                   
                        </telerik:RadContextMenu>
                    </telerik:RadContextMenu.ContextMenu>
         
        </TextBox>
        </DataTemplate>
        </telerik:RadDataForm.ReadOnlyTemplate>
        </telerik:RadDataForm>
        <TextBox x:Name="textBox"
         Width="200" ContextMenu="{x:Null}"
         VerticalAlignment="Top" Margin="141,125,176,0">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="ContextMenuHugo" ItemContainerStyle="{StaticResource MenuItemContainer}"
                                                >
 
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
 
        </TextBox>
    </Grid>

Thanks in advance
Boris
Telerik team
 answered on 14 Nov 2014
5 answers
127 views
Hello,

I am trying to use the CloudUpload within an ElementHost. When I choose a file and then click upload I get the following error:

Object reference not set to an instance of an object.
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.UpdateCommandsCanExecute()
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.SetState(CloudUploadFileState value)
   at Telerik.Windows.Cloud.Controls.Upload.CloudUploadFile.StartUpload()
   at Telerik.Windows.Cloud.Controls.RadCloudUpload.StartUpload(IEnumerable`1 items)
   ...

I'm setting up the CloudUpload like so:

            var upload = new RadCloudUpload();
            upload.Name = "radCloud1";
            upload.Provider = new DummyProvider();
            elementHost1.Child = upload;
 
 To confirm that I wasn't setting it up incorrectly I tried the same code without the element host and it works fine. Is the ElementHost unsupported?




Einar
Top achievements
Rank 1
 answered on 14 Nov 2014
7 answers
1.0K+ views

I want to put some text in the footer of a column in my gridview. However I can't get the binding to work.

 

I'm using MVVM. I have one viewmodel for the whole form including the gridview (let's call this MainViewModel) and also one viewmodel per row in the gridview (RowViewModel).

 

The text I want to show in the footer is in MainViewModel (let's call the property FooterText). How can I bind the text of the footer to this property?

 

My footer looks like this:

<telerikGridView:GridViewDataColumn.Footer>
    <TextBlock Text="Testing" />
</telerikGridView:GridViewDataColumn.Footer>

This example works and displays the text "Testing" in the footer. But my problems starts when I try to set the text using binding instead.

 

This doesn't work:

<telerikGridView:GridViewDataColumn.Footer>
    <TextBlock Text="{Binding Path=FooterText}" />
</telerikGridView:GridViewDataColumn.Footer>
I didn't expect this to work since all other properties of the column gets bound to the RowViewModel and not the MainViewModel. I'm guessing the same goes for the footer.

 

I've tried this:

<telerikGridView:GridViewDataColumn.Footer>
    <TextBlock Text="{Binding ElementName=LayoutRoot, Path=DataContext.FooterText}" />
</telerikGridView:GridViewDataColumn.Footer>

LayoutRoot is the Grid that is the root element of the form that the gridview resides in. This does not work. What confuses me is that I can bind the Header of the column in the exact way and it works:

<telerikGridView:GridViewDataColumn Header="{Binding ElementName=LayoutRoot, Path=DataContext.FooterText}" ... >

 

I've also tried this:

<telerikGridView:GridViewDataColumn.Footer>
    <TextBlock Text="{Binding Path=DataContext.FooterText, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=telerikGridView:RadGridView}}" />
</telerikGridView:GridViewDataColumn.Footer>

This didn't work neither.

 

Any more ideas?

Vanya Pavlova
Telerik team
 answered on 14 Nov 2014
1 answer
53 views
When I have the following in my XAML code:

<Window.Resources>
   <my:MyViewModel x:Key="MyViewModel"/>
 
    <Style x:Key="CalendarStyle" TargetType="telerik:RadCalendar"
              BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Expression_DarkTheme, ElementType=telerik:RadCalendar}}">
      <Setter Property="AreWeekNumbersVisible" Value="False" />
    </Style>
 
    <Style TargetType="{x:Type telerik:RadDateTimePicker}" BasedOn="{StaticResource {telerik:ThemeResourceKey ThemeType=telerik:Expression_DarkTheme, ElementType=telerik:RadDateTimePicker}}">
      <Setter Property="CalendarStyle">
          <Setter.Value>
          <Style BasedOn="{StaticResource CalendarStyle}" TargetType="telerik:RadCalendar">
          </Style>
        </Setter.Value>
      </Setter>
    </Style>
 
 
  </Window.Resources>
    <Grid DataContext="{StaticResource MyViewModel}">
    <telerik:RadGridView Grid.Row="0"
                             Name="clubsGrid"
                             ItemsSource="{Binding Clubs}"
                             AutoGenerateColumns="False"              
                             Margin="5">
            <telerik:RadGridView.Columns>  
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}"
                                            Header="Est."
                                            DataFormatString="{}{0:yyyy/MM/dd}"
                                     />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}"
                                            Header="Stadium"
                                            DataFormatString="{}{0:N0}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>


If I change AreWeekNumbersVisible to True, it works just fine. I am using telerik version 2013.3.1204.45.

See attached images.
Kalin
Telerik team
 answered on 14 Nov 2014
5 answers
391 views
I'm using Telerik DocumentSpellChecker together with a RadRichtextBox in a WPF-Application .

How do I do a case insensitive word comparison???
Petya
Telerik team
 answered on 14 Nov 2014
5 answers
356 views
Is it possible to use a ChartSeriesProvider with a CompositeCollection as the Source? Just specifying one as a StaticResource (which works fine for something like a ListBox that uses ItemsSource) results in an exception:
    Could not find property 'SeriesType' for type 'System.Windows.Data.CollectionContainer'

Example source of what I'm trying to do (modified version of the example Petar provided in this thread:

<Window x:Class="TwoDynamic.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <CollectionViewSource x:Key="FirstList" Source="{Binding Path=Series1}"/>
        <CollectionViewSource x:Key="SecondList" Source="{Binding Path=Series2}"/>
        <CompositeCollection x:Key="NewList">
            <CollectionContainer Collection="{Binding Source={StaticResource FirstList}}" />
            <CollectionContainer Collection="{Binding Source={StaticResource SecondList}}" />
        </CompositeCollection>
    </Window.Resources>
    <Grid>
        <telerik:RadCartesianChart>
            <telerik:RadCartesianChart.Resources>
                <Style TargetType="telerik:LineSeries">
                    <Setter Property="StrokeThickness" Value="2"/>
                    <Setter Property="Stroke" Value="Blue" />
                </Style>
                <Style TargetType="telerik:BarSeries">
                    <Setter Property="CombineMode" Value="None"/>
                </Style>
            </telerik:RadCartesianChart.Resources>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis LabelFitMode="Rotate" LabelFormat="MMM-dd" />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider Source="{StaticResource NewList}">
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
                        <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" TypePath="SeriesType" CategoryPath="Date" ValuePath="Value"/>
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>
        </telerik:RadCartesianChart>
    </Grid>
</Window>

And the ViewModel:
namespace TwoDynamic
{
    public class DataPoint
    {
        public DateTime Date { get; set; }
        public double Value { get; set; }
    }
    public class SeriesBase
    {
        public ObservableCollection<DataPoint> Data { get; set; }
        public Type SeriesType { get { return SeriesTypeOverride; } }
        public virtual Type SeriesTypeOverride { get { return null; } }
    }
    public class PointData : SeriesBase
    {
        public override Type SeriesTypeOverride { get { return typeof(BarSeries); } }
    }
    public class LineData : SeriesBase
    {
        public override Type SeriesTypeOverride { get { return typeof(LineSeries); } }
    }
    public class ViewModel
    {
        private Random _Random = new Random();
        public ObservableCollection<SeriesBase> Series1 { get; private set; }
        public ObservableCollection<SeriesBase> Series2 { get; private set; }
        public ViewModel()
        {
            Series1 = new ObservableCollection<SeriesBase>();
            Series1.Add(new PointData() { Data = GenerateSomeData() });
            Series1.Add(new PointData() { Data = GenerateSomeData() });
            Series2 = new ObservableCollection<SeriesBase>();
            Series2.Add(new LineData() { Data = GenerateSomeData() });
            Series2.Add(new LineData() { Data = GenerateSomeData() });
        }
        private ObservableCollection<DataPoint> GenerateSomeData()
        {
            ObservableCollection<DataPoint> newCollection = new ObservableCollection<DataPoint>();
            for (int i = 0; i < 10; i++)
                newCollection.Add(new DataPoint() { Date = new DateTime(2012, 12, 31).AddDays(i), Value = _Random.Next(100) });
            return newCollection;
        }
    }
}
Petar Marchev
Telerik team
 answered on 14 Nov 2014
1 answer
163 views
Hi there. I am using a dataform to allow updates to a small class that contains a numeric value (specifically a decimal type).  The autogenerated field for the variable doesn't seem to be permitting me to input a decimal point. 

Any thoughts?
Boris
Telerik team
 answered on 14 Nov 2014
2 answers
192 views
Hi,

I am trying to display current time with an annotation, but it gets missplaced when the vertical scrollbar is shown (see screenshots).

I think the reason for the issue is that the VirtualizingTimelinePanel for annotation occupies the whole radtimeline width while the VirtualizingTimelinePanel for items is shrink by the ScrollViewer.

I am using the Windows8 theme.

Is this a known issue? Is there a workaround for it?

Best,

Ola
Ola
Top achievements
Rank 1
 answered on 13 Nov 2014
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
InlineAIAssistant
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?