Telerik Forums
UI for WPF Forum
1 answer
118 views
Hi, I am new using Telerik controls and WPF, I saw the executive dashboard demo and I would like to create a chart like the one showing sales by product. I am reviewing the code but I donĀ“t really understad it, I think the control that is used is a BulletGraph.

There is this Page where you can see how to create a BulletGraph, but I don't know how to show the lines for the actual value and the target value.

Does anyone have an example to achieve a chart like that one?

Thanks,

Alberto


Evgenia
Telerik team
 answered on 24 Sep 2013
1 answer
71 views

When I add below  code in RadMenuItem and Trigger the print action , Mygrid is not binded and  TargetObject is null in invoke method.
It works fine for other system windows controls . Please help me to fix this issue.


 <telerik:RadMenuItem Header="Print">
i:EventTrigger EventName="Click">
                        <actions:PrintAction DocumentName="DocName" TargetName="MyGrid"  
                               TargetObject="{ Binding ElementName=MyGrid }"
                                   />
                </i:EventTrigger>
.......
.......
Rosen Vladimirov
Telerik team
 answered on 24 Sep 2013
7 answers
158 views
Hello,
i am just playing around with the ScheduleView and i found an error.

If you are in the WeekViewDefinition and change to MonthViewDefinition using pinch to zoom i get the following exception:

System.InvalidOperationException wurde nicht behandelt.
  Message="TargetType 'TimeRulerMonthViewGroupItem'" entspricht nicht dem Typ des Elements "TimeRulerGroupItem".
  Source=PresentationFramework
  StackTrace:
       bei System.Windows.Style.CheckTargetType(Object element)
       bei System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
       bei System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.FrameworkElement.set_Style(Style value)
       bei Telerik.Windows.Controls.ScheduleView.Extensions.SetStyleWithType(FrameworkElement element, Style style) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Helpers\Extensions.cs:Zeile 30.
       bei Telerik.Windows.Controls.ScheduleViewBase.EnsureElementStyle(FrameworkElement element, Style newStyle) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 781.
       bei Telerik.Windows.Controls.ScheduleViewBase.ApplyTickItemStyle(FrameworkElement container, Object item) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 1289.
       bei Telerik.Windows.Controls.TimeRulerPanel.PrepareItem(TimeRulerItemBase item) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\TimeRulerPanel.cs:Zeile 126.
       bei Telerik.Windows.Controls.RecycleHelper`1.PrepareItem(Int32 index) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Helpers\RecycleHelper.cs:Zeile 146.
       bei Telerik.Windows.Controls.RecycleHelper`1.PrepareItems(IValuesContainer indexTree, DateTime startDate, DateTime endDate) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Helpers\RecycleHelper.cs:Zeile 89.
       bei Telerik.Windows.Controls.TimeRulerPanel.PrepareItems() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\TimeRulerPanel.cs:Zeile 342.
       bei Telerik.Windows.Controls.TimeRulerPanel.MeasureOverride(Size availableSize) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\TimeRulerPanel.cs:Zeile 214.
       bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
       bei System.Windows.UIElement.Measure(Size availableSize)
       bei System.Windows.ContextLayoutManager.UpdateLayout()
       bei System.Windows.UIElement.UpdateLayout()
       bei Telerik.Windows.Media.Imaging.ExportHelper.GetBitmapSource(FrameworkElement element, Double dpiX, Double dpiY) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ExportHelper.cs:Zeile 92.
       bei Telerik.Windows.Media.Imaging.ExportHelper.GetElementImage(FrameworkElement element) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ExportHelper.cs:Zeile 70.
       bei Telerik.Windows.Controls.TransitionControl.TransitionPresenter.PrepareAnimation() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\TransitionControl\TransitionPresenter.cs:Zeile 301.
       bei Telerik.Windows.Controls.RadTransitionControl.PrepareAnimation() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\TransitionControl\RadTransitionControl.cs:Zeile 183.
       bei Telerik.Windows.Controls.RadScheduleView.OnActiveViewDefinitionChanged(ViewDefinitionBase oldValue, ViewDefinitionBase newValue) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\RadScheduleView.cs:Zeile 275.
       bei Telerik.Windows.Controls.ScheduleViewBase.OnActiveViewDefinitionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 2691.
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       bei Telerik.Windows.Controls.ScheduleViewBase.set_ActiveViewDefinition(ViewDefinitionBase value) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.cs:Zeile 1441.
       bei Telerik.Windows.Controls.RadScheduleView.SetView(ViewDefinitionBase resultView, Object dateTime) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\RadScheduleView.cs:Zeile 196.
       bei Telerik.Windows.Controls.RadScheduleView.SelectView[T](Object dateTime) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\RadScheduleView.cs:Zeile 179.
       bei Telerik.Windows.Controls.ScheduleViewBase.OnSetMonthViewModeExecuted(Object sender, ExecutedRoutedEventArgs e) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Commands.cs:Zeile 300.
       bei System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       bei System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       bei System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       bei System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       bei System.Windows.Input.RoutedCommand.Execute(Object parameter, IInputElement target)
       bei Telerik.Windows.Controls.ScheduleView.ScheduleViewTouchableElement.SemanticZoomOut(IList`1 originalPoints) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Touch\ScheduleViewTouchableElement.cs:Zeile 147.
       bei Telerik.Windows.Controls.ScheduleView.ScheduleViewTouchableElement.SemanticZoom(IList`1 originalPoints, Double delta) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Touch\ScheduleViewTouchableElement.cs:Zeile 184.
       bei Telerik.Windows.Input.Touch.GestureHandlers.PinchToSemanticZoomHandler.PinchFinished() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Input\Touch\GestureHandlers\PinchToSemanticZoomHandler.cs:Zeile 26.
       bei Telerik.Windows.Input.Touch.TouchHandler.RegisterPinchFinish() in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Input\Touch\TouchHandler.cs:Zeile 233.
       bei Telerik.Windows.Input.Touch.TouchHandler.RegisterTouchUp(TouchHandlerArgs args) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Input\Touch\TouchHandler.cs:Zeile 186.
       bei Telerik.Windows.Input.Touch.TouchHandlersController.RegisterTouchUp(Point point, TouchPoint[] touchPoints, Boolean& handled) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Input\Touch\TouchHandlersController.cs:Zeile 103.
       bei Telerik.Windows.Input.Touch.TouchHandlersController.Owner_TouchUp(Object sender, TouchEventArgs e) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Input\Touch\TouchHandlersController_WPF.cs:Zeile 219.
       bei System.Windows.Input.TouchEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.TouchDevice.RaiseTouchUp()
       bei System.Windows.Input.TouchDevice.ReportUp()
       bei System.Windows.Input.StylusLogic.PromoteMainUpToTouch(StylusDevice stylusDevice, StagingAreaInputItem stagingItem)
       bei System.Windows.Input.StylusLogic.PromoteMainToTouch(ProcessInputEventArgs e, StylusEventArgs stylusEventArgs)
       bei System.Windows.Input.StylusLogic.PromoteMainToOther(ProcessInputEventArgs e)
       bei System.Windows.Input.StylusLogic.PostProcessInput(Object sender, ProcessInputEventArgs e)
       bei System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
       bei System.Windows.Input.InputManager.ProcessStagingArea()
       bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bei System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
       bei System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       bei System.Threading.ExecutionContext.runTryCode(Object userData)
       bei System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Windows.Threading.DispatcherOperation.Invoke()
       bei System.Windows.Threading.Dispatcher.ProcessQueue()
       bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bei System.Windows.Application.RunDispatcher(Object ignore)
       bei System.Windows.Application.RunInternal(Window window)
       bei System.Windows.Application.Run(Window window)
       bei System.Windows.Application.Run()
       bei ScheduleViewError.App.Main() in C:\Users\a.karpinski\documents\visual studio 2010\Projects\ScheduleViewError\ScheduleViewError\obj\x86\Debug\App.g.cs:Zeile 0.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException: 



My XAML:
<Grid>
        <telerik:RadScheduleView
            AppointmentsSource="{Binding Items}"
                                             DockPanel.Dock="Top"
                                             IsManipulationEnabled="False"
                                             VerticalAlignment="Top" 
                                             VirtualizingStackPanel.VirtualizationMode="Standard"
                                             VirtualizingStackPanel.IsVirtualizing="False"
                                            SnapAppointments="True"
                                             
                                              
                                             NavigationHeaderVisibility="Collapsed"
                                             >
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:WeekViewDefinition
                                    DayEndTime="19:00:00"
                                    DayStartTime="07:00:00"
                                    MajorTickLength="1h"
                                    MinorTickLength="1h"
                                    TimerulerMajorTickStringFormat="{}{0:HHtt}:{0:mm}"
                                    TimerulerMinorTickStringFormat="{}{0:HHtt}:{0:mm}"
                                    ShowAllDayArea="False"
                                     
                                    MinTimeRulerExtent="300"
                                    VisibleDays="5" >
                </telerik:WeekViewDefinition>
                <telerik:DayViewDefinition
                               TimerulerMajorTickStringFormat="{}{0:HHtt}:{0:mm}"
                               TimerulerMinorTickStringFormat="{}{0:HHtt}:{0:mm}"
                                ShowAllDayArea="False"
                               DayEndTime="19:00:00"
                                    DayStartTime="07:00:00"
                                    MajorTickLength="1h"
                                    MinorTickLength="1h"
                                >
 
                </telerik:DayViewDefinition>
                <telerik:MonthViewDefinition
                                 TimerulerMajorTickStringFormat="{}{0:HHtt}:{0:mm}"
                                DayEndTime="19:00:00"
                                DayStartTime="07:00:00"
                                StretchGroupHeaders="False"
                                >
 
                </telerik:MonthViewDefinition>
 
            </telerik:RadScheduleView.ViewDefinitions>
 
             
        </telerik:RadScheduleView>
    </Grid>


Andreas
Top achievements
Rank 1
 answered on 23 Sep 2013
3 answers
340 views
Hi,
I am using the diagram control in my xaml file and i have two shapes(any) . there is one textbox  to set the raddiagramshape fontsize property.

so in xaml i have implemented this like as follows

Text="{Binding Path=SelectedItem.FontSize,ElementName=frontdiagram,Mode=TwoWay}"

when i select any shape in diagram then textbox show the current fontsize of that shape and when i change the value from the textbox then it is changing the fontsize of the current selected shape .

the problem is if I selected more than one shapes then it won't work meaning it is changing the font of only one shape. so to achieve this i have took the selectionchanged even of the diagram control on shape selection change i am getting the collection of selected items and then i am able to do the font change for every selected item but undo is not working in this case. when i press ctrl + z then it won't undo the last action for fontchange . how to achieve this and why this is happening .
if i am using xaml code to achieve then multiple selected font couldn't reflect but undo work and if i use the codebehind to solve the problem then undo couldn't work
Note : - setting pane do provide this feature meaning if you select the two shapes and change the font then it will change for both shapes and undo also work in that . This same thing i want to implement for this textbox.
please help.
Stefan
Telerik team
 answered on 23 Sep 2013
3 answers
162 views
Hi,

I have a myRadGridView binded to a QueryableEntityCollectionView<tableName> property. All worked perfect.
But when I create a Task to fill that property (that was binded to my RadGridView) it appears a messaje saying:

Ocurrió System.InvalidOperationException
  HResult=-2146233079
  Message=El subproceso que realiza la llamada no puede obtener acceso a este objeto porque el propietario es otro subproceso.
  Source=WindowsBase
  StackTrace:
       en System.Windows.DependencyObject.GetValue(DependencyProperty dp)
       en Telerik.Windows.Data.SortDescriptor.get_Member() en c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Data\Sorting\SortDescriptor.cs:lĆ­nea 22
  InnerException: 


I'm using a MVVM pattern.
The definition of my property binded to my RadGridView is:
private QueryableEntityCollectionView<PROTOCOL> protocolsView;
public QueryableEntityCollectionView<PROTOCOL> ProtocolsView
{
    get { return protocolsView; }
    set
    {
        protocolsView = value;
        RaisePropertyChanged("ProtocolsView");
    }
}


The code I have written in the ViewModel is:
Task.Factory.StartNew(new Action(() =>
            {
 
                DbContext dbContext = new wafintellectEntities(Global.Configuracion.CadenaConexionBDEntity); // connection to BD
                ObjectContext objectContext = ((System.Data.Entity.Infrastructure.IObjectContextAdapter)dbContext).ObjectContext;
                bool error = false;
                try
                {
                    //ProtocolsView = new QueryableEntityCollectionView<PROTOCOL>(objectContext, "PROTOCOLs");
                    results = new QueryableEntityCollectionView<PROTOCOL>(objectContext, "PROTOCOLs");
                }
                catch (Exception e)
                {
                    error = true;
                    MessageBox.Show("Cadena de conexión errónea. Por favor, configure la conexión con la BD correctamente." + System.Environment.NewLine + e.Message, "Imposible cargar datos", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
                }
                mi.Invoke(new Action(() =>
                {
                    if (!error)
                    {
                        ProtocolsView = results; // "ProtocolsView " is the property binded to my RadGridView
                    }
                }));
}));

The RadGridView is:
<telerik:RadGridView
    x:Name="grdProtocol"
    ItemsSource="{Binding ProtocolsView}"
    AutoGenerateColumns="False"
    SelectionUnit="FullRow"
    GridLinesVisibility="Horizontal"
    CanUserDeleteRows="False"
    CanUserInsertRows="False"
    CanUserFreezeColumns="False"
    RowIndicatorVisibility="Collapsed"
    IsReadOnly="True"
    ShowGroupPanel="False" Grid.ColumnSpan="2">
</telerik:RadGridView>

In the ViewModel, if I change the definition of the property and the code of the Task for the next one code, it works:
private IQueryable protocolsView;
        public IQueryable ProtocolsView
        {
            get { return protocolsView; }
            set
            {
                protocolsView = value;
                RaisePropertyChanged("ProtocolsView");
            }
        }
Task.Factory.StartNew(new Action(() =>
            {
                try
                {
                    wafintellectEntities myEntity = new wafintellectEntities(Global.Configuracion.CadenaConexionBDEntity); // connection to BD
                    ProtocolsView = myEntity.PROTOCOLs; // get the entire data of the table PROTOCOLs
                }
                catch
                {
                    MessageBox.Show("Error al abrir BD...");
                }
            }));



So, my question is:
How can I use QueryableEntityCollectionView<tableName> in a Task?

Thanks.

Sonia.
Dimitrina
Telerik team
 answered on 23 Sep 2013
3 answers
345 views
Hello ,

i am using radtabcontrol , in which when initially control is loaded everything works fine, but if i change the datacontext when control is still active , the data is not loaded with in the tabs , but tabs are visible, once i click on the tab data is visible.

following screenshots may help 
1. initial load when first time data is loaded.(intialload
2.when datacontext is changed(datacontextchanged)
3. when i click on any tab once data is loaded(afterclickingatab)

i want my ui to look like 3 when datacontext change happens , do you have any idea why this is happening ?

my xaml look like this -
<Window x:Class="TabPanelInstanceValidator.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:tabPanelInstanceValidator="clr-namespace:TabPanelInstanceValidator"
        Title="MainWindow" Height="350" Width="525">
 
    <telerik:RadTabControl ItemsSource="{Binding}" DisplayMemberPath="header"  >
        <telerik:RadTabControl.ContentTemplate>
            <DataTemplate>
                <telerik:RadDocking>
                    <telerik:RadDocking.DocumentHost>
                        <telerik:RadGridView  AutoGenerateColumns="False" ShowGroupPanel="False"  ItemsSource="{Binding Elements}"   >
                          <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Path}"  Width="*" Header="elements"></telerik:GridViewDataColumn>
                            </telerik:RadGridView.Columns>
                            <telerik:RadGridView.RowStyle>
                                <Style TargetType="telerik:GridViewRow">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                            <telerik:RadExpander ExpandDirection="Down" Name="check"  Header="{Binding Path}">
                                                <GroupBox>
                                                    <GroupBox.Header>
                                                        <CheckBox>ShowAll</CheckBox>
                                                    </GroupBox.Header>
                                                        <tabPanelInstanceValidator:CustomRadGridView  AutoGenerateColumns="False"  AssignableColumns="{Binding}"  DataContext="{Binding FeedData}"  RowIndicatorVisibility="Hidden" >
                                                    </tabPanelInstanceValidator:CustomRadGridView>
                                                </GroupBox>
                                                </telerik:RadExpander>
                                            
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </telerik:RadGridView.RowStyle>
 
                          
                        </telerik:RadGridView>
                    </telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer InitialPosition="DockedLeft">
                        <telerik:RadPaneGroup>
                            <telerik:RadPane IsPinned="False" CanFloat="False" Header="Legend">
                                <StackPanel>
                                <Button Click="ButtonBase_OnClick">changedatacontext</Button>
                                <TextBlock>test</TextBlock>
                                </StackPanel>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
 
                </telerik:RadDocking>
            </DataTemplate>
        </telerik:RadTabControl.ContentTemplate>
 
    </telerik:RadTabControl>
 
 
</Window>

the code behind for same is -
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Input;
 
namespace TabPanelInstanceValidator
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            List<Rules> abc = new List<Rules>();
            abc.Add(new Rules("interface Rule")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|Control")
                                                         {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}
                                                                                          ,new ElementRule("Motor|SuperVision") {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}}
            });
            abc.Add(new Rules("element rules")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|sbdk1")
                                                                                          {
                                                                                               FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}, new ElementRule("Motor|sbdk2")
                                                                 {
                                                                    FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        },
                                                                                        new Rule()
                                                                                            {
                                                                                                name = "RuleTest3",
                                                                                                status = "Prohibited"
                                                                                            }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }, new Rule()
                                                                                            {
                                                                                                name = "RuleTest3",
                                                                                                status = "Prohibited"
                                                                                            }
                                                                                }
                                                                },
                                                         }  
                                                                 } }
            });
            this.DataContext = abc;
        }
 
      
 
        private void UIElement_OnMouseEnter(object sender, MouseEventArgs e)
        {
            throw new NotImplementedException();
        }
 
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            List<Rules> abc = new List<Rules>();
            abc.Add(new Rules("interface Rule")
            {
                Elements = new List<ElementRule>() { new ElementRule("Motor|Control")
                                                         {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                         new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}
                                                                                          ,new ElementRule("Motor|SuperVision") {
                                                            FeedData = new List<RuleCollect>()
                                                         {
                                                            new RuleCollect()
                                                                {
                                                                    element = "sample",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        },
                                                                                        new Rule()
                                                                                        {
                                                                                            name = "RuleTest2",
                                                                                            status = "Optional"
                                                                                        }
                                                                                }
                                                                },
                                                              new RuleCollect()
                                                                {
                                                                    element = "sample1",
                                                                    rules = new List<Rule>()
                                                                                {
                                                                                    new Rule()
                                                                                        {
                                                                                            name = "RuleTest",
                                                                                            status = "Required"
                                                                                        }
                                                                                }
                                                                },
                                                         }}}
            });
            abc.Add(new Rules("testrule")
                        {
                            Elements = new List<ElementRule>() { new ElementRule("check")}
                        });
          
            this.DataContext = abc;
            
           // aa.SelectedIndex = 1;
 
        } 
    }
}
Pavel R. Pavlov
Telerik team
 answered on 23 Sep 2013
1 answer
150 views
I wanted to add a column chooser functionality in the gridview. I have done it in past but had a question that can it be acheived by just adding a header cell from codebehind or by any other way. I have done it by using the row indicator column and using the space on the header to open choose column window, which i have attached a image of that. 

Question here is that is there a way to hide the row indicator column and just use the extra header on top/ or code behind way to add a header cell which handles this functionality. 


Thanks,

Dimitrina
Telerik team
 answered on 23 Sep 2013
3 answers
145 views
Hello,

I have found that even though i set the correct (german) culture on currentthread and CurrentUIThread, RadGanttView still uses a 12 hour format fo display times when zoomed in. I'd like to change this to a corresponding 24-hour format, that is used the default for this culture.

I would expect the ganttview to respect certain culture settings like this.

How can i achieve this?

Thanks
Vladi
Telerik team
 answered on 23 Sep 2013
5 answers
210 views
What would be involved to use the diagram control in a lightswitch application (if at all possible)?
Pavel R. Pavlov
Telerik team
 answered on 23 Sep 2013
2 answers
175 views

N.B. Framework 4.5

// first in Application  App.cs set at runtime theme windows8
protected override void OnStartup(StartupEventArgs e)
{           
    StyleManager.ApplicationTheme = new Windows8Theme();                   
}

// Then create two VIEW

// First is MASTER_VIEW
// ADD XAML
  <telerik:RadTabControl Grid.Row="0" >

            <telerik:RadTabItem DropDownContent="Trend Import" Header="DETAIL" >
                <telerik:RadTabItem.Content>
                    <views:DETAIL_VIEW/>
                </telerik:RadTabItem.Content>
            </telerik:RadTabItem>

</telerik:RadTabControl>

// ADD SECOND XAML -> DETAIL_VIEW
<Grid>

   <GroupBox Header="tyy tyy" >
           <TextBlock Text="Settings"/> 
    </GroupBox>
 </Grid>
      
Build and run WPF APPLICATION

TextBlock is not visible. Cannot see content(Text) of any TextBlock controls?
I use default style at all.

Workaround:
Remove: OnStartup(StartupEventArgs e) function, stay at default theme.
You will see all textblock controls again.

Additional info: This bug depends and others controls like GroupBox and others.

Framework 4.5
VS2012

Telerik v. 2013.2.611.45 (For framework 4.5)

This is styles that I use. In comment is second workaround.

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  
    <ControlTemplate x:Key="TextBoxErrorTemplate">
        <DockPanel LastChildFill="True" >
            <Border BorderBrush="Red" BorderThickness="1" >
                <AdornedElementPlaceholder x:Name="Holder"  />
            </Border>
            <Label  Foreground="White" Content="{Binding ElementName=Holder, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}" BorderThickness="1" BorderBrush="White" Background="Red" UseLayoutRounding="True"  />
        </DockPanel>
    </ControlTemplate>
  
      
    <Style TargetType="Button"
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="IsEnabled" Value="False"/>                                        
                </Trigger>
                <Trigger Property="Validation.HasError" Value="false">
                    <Setter Property="IsEnabled" Value="True"/>                     
                </Trigger>                
            </Style.Triggers>
    </Style>
  
    <Style x:Key="LinkButton" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <TextBlock TextDecorations="Underline">
                    <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="Cursor" Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
  
 <!--
    <Style TargetType="TextBlock">
        <Setter Property="Foreground" Value="#FF151515" />       
    </Style>
  
    <Style TargetType="GroupBox">
        <Setter Property="Foreground" Value="#FF151515" />
    </Style>
-->
      
</ResourceDictionary>
     


                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
  
    
  
    <Style x:Key="LinkButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <TextBlock TextDecorations="Underline">
                        <ContentPresenter />
                    </TextBlock>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="Blue" />
        <Setter Property="Cursor" Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Foreground" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>
  
</ResourceDictionary>
kity
Top achievements
Rank 2
 answered on 23 Sep 2013
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?