Telerik Forums
UI for WPF Forum
2 answers
113 views
hello All,
In my project I've a Module in which I want to Display my 1 Table Data user. So I created a RadGridView. At designer it shows. and Control., Data, Input dlls are also in reference.
When I Run my application I'm getting

 
  Microsoft.Practices.Prism.Modularity.ModuleInitializeException was unhandled by user code
  Message=An exception occurred while initializing module 'AdminModule'.
    - The exception message was: Resolution of the dependency failed, type = "Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab", name = "(none)".
Exception occurred while: Calling constructor Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab(Delasoft.Hpms.Module.Admin.UserTab.ViewModel.IUsersTabViewModel viewModel).
Exception is: XamlParseException - The type 'RadGridView' was not found. [Line: 13 Position: 96]
-----------------------------------------------
At the time of the exception, the container was:
 
  Resolving Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab,(none)
  Calling constructor Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab(Delasoft.Hpms.Module.Admin.UserTab.ViewModel.IUsersTabViewModel viewModel)
 
    - The Assembly that the module was trying to be loaded from was:Delasoft.Hpms.Module.Admin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
    Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
   
  ModuleName=AdminModule
  StackTrace:
       at Microsoft.Practices.Prism.Modularity.ModuleInitializer.HandleModuleInitializationError(ModuleInfo moduleInfo, String assemblyName, Exception exception)
       at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
       at Microsoft.Practices.Prism.Modularity.ModuleManager.InitializeModule(ModuleInfo moduleInfo)
       at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesThatAreReadyForLoad()
       at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModuleTypes(IEnumerable`1 moduleInfos)
       at Microsoft.Practices.Prism.Modularity.ModuleManager.LoadModulesWhenAvailable()
       at Microsoft.Practices.Prism.Modularity.ModuleManager.Run()
       at Microsoft.Practices.Prism.UnityExtensions.UnityBootstrapper.InitializeModules()
       at Microsoft.Practices.Prism.UnityExtensions.UnityBootstrapper.Run(Boolean runWithDefaultConfiguration)
       at Microsoft.Practices.Prism.Bootstrapper.Run()
       at Delasoft.Hpms.App.Application_Startup(Object sender, StartupEventArgs e)
       at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
  InnerException: Microsoft.Practices.Unity.ResolutionFailedException
       Message=Resolution of the dependency failed, type = "Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab", name = "(none)".
Exception occurred while: Calling constructor Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab(Delasoft.Hpms.Module.Admin.UserTab.ViewModel.IUsersTabViewModel viewModel).
Exception is: XamlParseException - The type 'RadGridView' was not found. [Line: 13 Position: 96]
-----------------------------------------------
At the time of the exception, the container was:
 
  Resolving Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab,(none)
  Calling constructor Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab(Delasoft.Hpms.Module.Admin.UserTab.ViewModel.IUsersTabViewModel viewModel)
 
       TypeRequested=UsersTab
       StackTrace:
            at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
            at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides)
            at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
            at Microsoft.Practices.Unity.UnityContainerExtensions.Resolve[T](IUnityContainer container, ResolverOverride[] overrides)
            at Delasoft.Hpms.Module.Admin.AdminModule.Initialize()
            at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
       InnerException: System.Windows.Markup.XamlParseException
            Message=The type 'RadGridView' was not found. [Line: 13 Position: 96]
            LineNumber=13
            LinePosition=96
            StackTrace:
                 at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
                 at Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab.InitializeComponent()
                 at Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab..ctor(IUsersTabViewModel viewModel)
                 at BuildUp_Delasoft.Hpms.Module.Admin.UserTab.View.UsersTab(IBuilderContext )
                 at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                 at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
            InnerException:

What is Going wrong? Si my Prim  not recognizing or some thing else ? How to resolve this.

Please help.

Greetings
Dimitrina
Telerik team
 answered on 18 Jul 2014
3 answers
274 views
Hello,

I'm trying to implement some Drag and Drop functionality on an inhomogenious RadTreeView. I started from the "Tree to Grid Drag" Demo project.
There you define some DropIndicationDetails to display the input location. However I don't like this style (and the fact that I have to create a datatemplate for drag and drop) - which is why I want to use the default drag/drop appearance with the Windows 8 style (see attached image).

I therefore created a simplified version of the TreeViewDragDopBehavior:

public class TreeViewDragDropBehavior
{
    public static bool GetIsEnabled(DependencyObject obj)
    {
        return (bool)obj.GetValue(IsEnabledProperty);
    }
 
    public static void SetIsEnabled(DependencyObject obj, bool value)
    {
        obj.SetValue(IsEnabledProperty, value);
    }
 
    public static readonly DependencyProperty IsEnabledProperty =
        DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(TreeViewDragDropBehavior),
            new PropertyMetadata(OnIsEnabledPropertyChanged));
 
    public static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
    {
        if (true.Equals(e.NewValue))
        {
            Initialize(dependencyObject as RadTreeView);
        }
        else
        {
            CleanUp(dependencyObject as RadTreeView);
        }
    }
 
    protected static void Initialize(RadTreeView treeView)
    {
        DragDropManager.AddDragInitializeHandler(treeView, OnDragInitialize, true);
        DragDropManager.AddGiveFeedbackHandler(treeView, OnGiveFeedback, true);
        DragDropManager.AddDragDropCompletedHandler(treeView, OnDragDropCompleted, true);
        DragDropManager.AddDropHandler(treeView, OnDrop, true);
 
        treeView.ItemPrepared += AssociatedObject_ItemPrepared;
    }
 
    protected static void CleanUp(RadTreeView treeView)
    {
        DragDropManager.RemoveDragInitializeHandler(treeView, OnDragInitialize);
        DragDropManager.RemoveGiveFeedbackHandler(treeView, OnGiveFeedback);
        DragDropManager.RemoveDragDropCompletedHandler(treeView, OnDragDropCompleted);
        DragDropManager.RemoveDropHandler(treeView, OnDrop);
    }
 
    static void AssociatedObject_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
    {
        DragDropManager.RemoveDragOverHandler(e.PreparedItem, OnItemDragOver);
        DragDropManager.AddDragOverHandler(e.PreparedItem, OnItemDragOver);
    }
 
    private static void OnDragInitialize(object sender, DragInitializeEventArgs e)
    {
        var treeViewItem = e.OriginalSource as RadTreeViewItem ?? (e.OriginalSource as FrameworkElement).ParentOfType<RadTreeViewItem>();
        var data = treeViewItem != null ? treeViewItem.Item : (sender as RadTreeView).SelectedItem;
 
        var payload = DragDropPayloadManager.GeneratePayload(null);
        payload.SetData("DraggedData", data);
 
        e.Data = payload;
        e.DragVisualOffset = e.RelativeStartPoint;
        e.AllowedEffects = DragDropEffects.All;
    }
 
    private static void OnGiveFeedback(object sender, Telerik.Windows.DragDrop.GiveFeedbackEventArgs e)
    {
        e.SetCursor(Cursors.Arrow);
        e.Handled = true;
    }
 
    private static void OnDragDropCompleted(object sender, DragDropCompletedEventArgs e)
    {
        e.Handled = true;
    }
 
    private static void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
    {
    }
 
    private static void OnItemDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
    {
        e.Effects = DragDropEffects.All;
        e.Handled = true;
    }
}

However, although I set 'e.Effects = DragDropEffects.All' in the OnItemDragOver method, it always shows the forbidden icon (in the OnDrop method, the Effects are correct). If I do not set the payload (by simply commenting out this line in the OnDragInitialize method), I get the expected appearance as in the screen shot. However - the OnItemDragOver method is never called. Therefore, I don't have any possibility to manually override the e.Effects settings.

Is there any way to influence the effects if I dont set the payload manually? Or alternatively to show the correect drop position without having handle it manually?

By the way - there is a very severy memory leak in your original example! You store the TreeViewDragDropBehavior in a static dictionary, together with the RadTreeView. This keeps the TreeViewDragDropBehavior, its associated RadTreeView, it's TreeViewItems and the corresponding data alive forever.

Alexander Müller
Petar Mladenov
Telerik team
 answered on 18 Jul 2014
1 answer
129 views
Hi,
I'm using RadTabControl and i have a problem with reloading. If add two tabs and edit first tab content and go to second tab and come back it lost the content. If I edit any tab content and click to this tab title and go to another tab and come back it binds and chenges context. I have a lost focus event for textbox(content) if i set break point  to lost focus event and after running i test all situation it's good working but i need to change Note.Content property in lost focus by binding Content textbox with content property. Content property is in Note class.
Can anybody help me?
Please advice as soon as possible
Thanx Jamshed
Jamshed
Top achievements
Rank 1
 answered on 18 Jul 2014
1 answer
139 views
I need to alter the default validation error styles in the RadGridView.  Errors are generated via INotifyDataErrorInfo

One of the main changes is to remove the "reddish" background that is shown on the row when an error exists in one of the columns.

I have been trying to follow the instructions for styling a row here: http://www.telerik.com/help/wpf/gridview-styling-a-row.html

The instructions indicate one should be able to go to Object -> Edit Additional Styles -> Edit Row Style -> Edit a copy...

However, the only option I have is "Create Empty..." so am unsure as to what the original style looks like so it is difficult to alter.  The instructions indicate I should be able to "Edit a copy..." which would give me the style properties I need.

Is there something I'm missing?

Here is a quick example of the XAML being used:

<Window x:Class="TelerikGridTest.MainWindow"
        xmlns:telerikGridTest="clr-namespace:TelerikGridTest"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525" d:DataContext="{d:DesignInstance telerikGridTest:ViewModel}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Transparent;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <telerik:RadGridView ItemsSource="{Binding Rows}" ActionOnLostFocus="None" GroupRenderMode="Flat" AutoGenerateColumns="False" CanUserInsertRows="True" NewRowPosition="Bottom" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Column One" DataMemberBinding="{Binding ColumnOne, UpdateSourceTrigger=PropertyChanged}" />
                <telerik:GridViewDataColumn Header="Column Two" DataMemberBinding="{Binding ColumnTwo, UpdateSourceTrigger=PropertyChanged}"/>
                <telerik:GridViewDataColumn Header="Column Three" DataMemberBinding="{Binding ColumnThree, UpdateSourceTrigger=PropertyChanged}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

Yoan
Telerik team
 answered on 17 Jul 2014
4 answers
81 views
Hi,

I see that snap mode has three options; None, AllClosePoints, ClosestPoint. However I was wondering if it is possible to snap to a given series only? For example series 1 has 300 data points but series 2 only has 100 (both can be plotted on the same chart). I would like the TrackBallInfo to only snap to data points in series 2 (but show data for 1 and 2)

Thanks for your help!
James
Top achievements
Rank 1
 answered on 17 Jul 2014
1 answer
1.1K+ views
Hi,
I am using telerik RadGridview 2013 Q3.  We have a N-Tier app, so I am saving the record per row instead of per cell.  I have a requirement from the business user mandating a confirmation dialog to be shown asking if the user wants to save the data when the user navigates away from the current editing row.  I tried to show the confirmation dialog at the roweditended event, but when the user clicks on No, the row's edit mode is still being ended. I don't want the edit mode to end when the user does not want to save the row and I want the focus to stay on the current editing cell.

The way I think this might  work is that if we can somehow stop the roweditended event chain in code, I tried to call e.Handled = true, but that doesn't do anything, the row is still being edit ended.
A workaround I found is that If I move the confirmation dialog code to the rowvalidating event and set the IsValid to false to stop the row edit ended event being fired, however this causes an undesired side effect of the row turning to red, I have consulted with the business users, and they feel like it's too confusing to have the background turn red when there's no validation error.
My question would be, how does telerik cancel the row level editing event without setting the IsValid to false?
Boris
Telerik team
 answered on 17 Jul 2014
1 answer
167 views
I was testing out this panel but found that it does not support item container recycling. E.g., if I set:

VirtualizingPanel.VirtualizationMode="Recycling"

Item containers are still created new each and every time. Are there any plans to support this feature? WPF's default VirtualizingStackPanel supports it OOTB, so I was expecting it here as well.
Ivan Ivanov
Telerik team
 answered on 17 Jul 2014
1 answer
106 views
Is it possible to disable tile reordering (by the user), without disabling the entire TileList control?
Maya
Telerik team
 answered on 17 Jul 2014
7 answers
315 views
Hi,
I'm working on a WPF desktop application using RadControls for WPF version 2010.1.0603.35.
I have a number of ListView and RadTreeView controls that are Drag and Drop enabled. They also have a RadContextMenu. The problem I have is when I right click on an item then immediately left click the same or another item in the control. This seems to enable drag and drop and sometimes move items around. In order to reproduce this I used the Demo solution installed with the Telerik product. I took the DragAndDrop TreeToGrid example and I added a RadContextMenu to the ListBox and the RadTreeView as shown below.
<nav:RadTreeView x:Name="allProductsView" 
        ItemTemplateSelector="{StaticResource ExampleTemplateSelector}" 
        ItemContainerStyle="{StaticResource TreeViewItemStyle}" 
        IsDragDropEnabled="True" Background="White" BorderThickness="1" 
        BorderBrush="LightGray"   
        Padding="16">  
    <telerikNavigation:RadContextMenu.ContextMenu> 
        <telerikNavigation:RadContextMenu > 
            <telerikNavigation:RadMenuItem Header="RadTreeView Menu 1" /> 
            <telerikNavigation:RadMenuItem Header="RadTreeView Menu 2"  /> 
        </telerikNavigation:RadContextMenu> 
    </telerikNavigation:RadContextMenu.ContextMenu> 
</nav:RadTreeView> 
 
<ListBox x:Name="wishlistView" Grid.Column="2" 
        telerik:StyleManager.Theme="Office_Black" SelectionMode="Extended" 
        dragDrop:RadDragAndDropManager.AllowDrop="True" 
        ItemTemplate="{StaticResource WishlistProduct}" 
        ItemContainerStyle="{StaticResource WishlistItemStyle}" Padding="16" > 
    <telerikNavigation:RadContextMenu.ContextMenu> 
        <telerikNavigation:RadContextMenu > 
            <telerikNavigation:RadMenuItem Header="ListBox Menu 1" /> 
            <telerikNavigation:RadMenuItem Header="ListBox Menu 2"  /> 
        </telerikNavigation:RadContextMenu> 
    </telerikNavigation:RadContextMenu.ContextMenu> 
</ListBox> 
Using this example you can right-click on any item under Wishlist and then immediately left-click on a different item under the same control. The items will most likely shuffle around. In any case (on the RadTreeView also) it will enable the drag and drop event and that is not desirable functionality for me.

Your help is very much appreciated.

Thank you,
Ogi Ivanov

Martin Ivanov
Telerik team
 answered on 17 Jul 2014
2 answers
43 views
Good day.
I need to catch changes Expanded and under certain conditions, to cancel this action.
I tried to implement this by using event GroupRowIsExpandedChanging, but property args.Row.IsExpanded has changed.
Help me, please :(
Alexandr
Top achievements
Rank 1
 answered on 17 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?