Telerik Forums
UI for WPF Forum
2 answers
808 views
<UserControl  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:s="clr-namespace:RttmVision.Presentation" 
    xmlns:p="clr-namespace:RttmVision.Presentation.Properties" 
    xmlns:c="clr-namespace:RttmVision.Presentation.Converters" 
    xmlns:widgets="clr-namespace:RttmVision.Applications.Widgets;assembly=RttmVision.Applications" 
    xmlns:services="clr-namespace:RttmVision.Applications.Services;assembly=RttmVision.Applications" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    xmlns:telerikAnimation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls" 
    xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
     xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
   xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:telerikDragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls" 
    x:Class="RttmVision.Presentation.Views.BasicWidgetView" 
        
    MinHeight="300" MinWidth="300"  Loaded="ThisLoaded" 
       telerikDragDrop:RadDragAndDropManager.AllowDrag="True"           
          
    > 
 
    <UserControl.Resources> 
 
        <!-- ResizeDecorator Template --> 
        <ControlTemplate x:Key="ResizeDecoratorTemplate"  TargetType="{x:Type Control}">  
            <Grid > 
                <s:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 -4 0 0" 
                       VerticalAlignment="Top" HorizontalAlignment="Stretch"/>  
                <s:ResizeThumb Width="3" Cursor="SizeWE" Margin="-4 0 0 0" 
                       VerticalAlignment="Stretch" HorizontalAlignment="Left"/>  
                <s:ResizeThumb Width="3" Cursor="SizeWE" Margin="0 0 -4 0" 
                       VerticalAlignment="Stretch" HorizontalAlignment="Right"/>  
                <s:ResizeThumb Height="3" Cursor="SizeNS" Margin="0 0 0 -4" 
                       VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/>  
                <s:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="-6 -6 0 0" 
                       VerticalAlignment="Top" HorizontalAlignment="Left"/>  
                <s:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="0 -6 -6 0" 
                       VerticalAlignment="Top" HorizontalAlignment="Right"/>  
                <s:ResizeThumb Width="7" Height="7" Cursor="SizeNESW" Margin="-6 0 0 -6" 
                       VerticalAlignment="Bottom" HorizontalAlignment="Left"/>  
                <s:ResizeThumb Width="7" Height="7" Cursor="SizeNWSE" Margin="0 0 -6 -6" 
                       VerticalAlignment="Bottom" HorizontalAlignment="Right"/>  
            </Grid> 
        </ControlTemplate> 
 
        <!-- Designer Item Template--> 
        <ControlTemplate x:Key="DesignerItemTemplate" TargetType="ContentControl">  
            <Grid Height="Auto" Width="Auto" 
                DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=.}">  
                <s:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/>  
                <Control  Template="{StaticResource ResizeDecoratorTemplate}"/>  
                <ContentPresenter Content="{TemplateBinding Content}"    /> 
            </Grid> 
 
        </ControlTemplate> 
 
        <!--Popup--> 
        <!--We have a style because we are actually going to be using multiple thumbs for   
        resizing (one for the bottom edge, one for the corner, and one for the right edge),  
        and this way we don't have to repeat these property and event setters. --> 
        <Style TargetType="{x:Type Thumb}"   
          x:Key="PopupThumb">  
            <!--Setting the alignment properties to stretch just guarantees that the thumbs will fill their respective conta--> 
            <Setter Property="HorizontalAlignment"   
             Value="Stretch"/>  
            <Setter Property="VerticalAlignment"   
             Value="Stretch"/>  
            <EventSetter Event="Thumb.DragStarted"   
                  Handler="ThumbDragStarted" /> 
            <EventSetter Event="Thumb.DragDelta"   
                  Handler="ThumbDragDelta" /> 
            <EventSetter Event="Thumb.DragCompleted"   
                  Handler="ThumbDragCompleted" /> 
        </Style> 
 
        <!--Setup for Popup TreeView--> 
 
 
        <Style x:Key="Expander" TargetType="{x:Type ToggleButton}">  
            <Setter Property="IsEnabled" Value="True" /> 
            <Setter Property="IsTabStop" Value="False" /> 
            <Setter Property="Cursor" Value="Hand"/>  
            <Setter Property="Template">  
                <Setter.Value> 
                    <ControlTemplate TargetType="{x:Type ToggleButton}">  
                        <Grid x:Name="Button" Margin="0,4,0,0" HorizontalAlignment="Right" 
                              VerticalAlignment="Top" Width="16" Height="16">  
                            <Rectangle Stroke="#FF027BA6" HorizontalAlignment="Stretch" 
                                  VerticalAlignment="Stretch" Width="Auto" Height="Auto" 
                                  RadiusX="3" RadiusY="3" Fill="#FF00A2DC"/>  
                            <Rectangle x:Name="CollapsedVisual" HorizontalAlignment="Left" 
                                  VerticalAlignment="Top" Width="2" Height="8" RadiusX="0" 
                                  RadiusY="0" Fill="#FFFFFFFF" Margin="7,4,0,0" /> 
                            <Rectangle RadiusX="0" RadiusY="0" Fill="#FFFFFFFF" 
                                  HorizontalAlignment="Left" Margin="4,7,0,0" 
                                  VerticalAlignment="Top" Width="8" Height="2" /> 
                        </Grid> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 
 
 
 
        <!--Converter for CheckState--> 
        <s:CheckStateConverter x:Key="CheckStateConverter" /> 
        <c:CellbackGroundColorConverter  
                            x:Key="colorConverter" /> 
 
        <!--Bindings collection for the RadTreeViewItems--> 
        <Style x:Key="BindingsCollection"  TargetType="{x:Type telerikNavigation:RadTreeViewItem}" > 
            <Setter Property="CheckState" Value="{Binding Checked, Mode=TwoWay, Converter={StaticResource CheckStateConverter}}" /> 
            <Setter Property="IsSelected" Value="{Binding Selected, Mode=TwoWay}" /> 
            <Setter Property="IsExpanded" Value="{Binding Expanded, Mode=TwoWay}" /> 
        </Style> 
 
 
        <DataTemplate x:Key="MessageName">  
            <TextBlock Text="{Binding MessageName}" ToolTip="Message Name" Foreground="Black" FontSize="10"></TextBlock> 
        </DataTemplate> 
 
        <HierarchicalDataTemplate   
            x:Key="PacketInfo"   
            ItemTemplate="{StaticResource MessageName}"   
            ItemsSource="{Binding Messages}">  
            <TextBlock Text="{Binding PacketName}" ToolTip="Packet Name" Foreground="Blue" FontSize="10"/>             
        </HierarchicalDataTemplate> 
 
 
 
        <!--End of setup for Popup TreeView--> 
 
 
    </UserControl.Resources> 
 
 
 
    <UserControl.ContextMenu> 
        <ContextMenu> 
            <MenuItem  Click="MenuItem_Click" Header="{x:Static p:Resources.ViewPackets}" Icon="" InputGestureText="{x:Static p:Resources.ControlR}" /> 
        </ContextMenu> 
    </UserControl.ContextMenu> 
 
    <ContentControl Width="200" 
                      Height="100" 
                      Padding="2" 
                      Canvas.Left="360" 
                      Canvas.Top="60" 
                      Template="{StaticResource DesignerItemTemplate}" 
                    > 
        <Grid   
            Width="Auto"   
            Height="Auto" > 
            <Grid.ColumnDefinitions> 
                <ColumnDefinition Width="13*" /> 
                <ColumnDefinition Width="187*" /> 
            </Grid.ColumnDefinitions> 
            <Border CornerRadius="5" 
                  IsHitTestVisible="False" 
                  BorderBrush="#E0E0E0" 
                  BorderThickness="0,1,0,0" 
                  Background="{DynamicResource FrameBackground}" Grid.ColumnSpan="2" /> 
            <Border BorderBrush="Black" 
                  BorderThickness="0,0,0,1" 
                  CornerRadius="5" Grid.ColumnSpan="2" /> 
            <Border Background="WhiteSmoke" CornerRadius="5" Margin="5,5,5,25" IsHitTestVisible="False" Grid.ColumnSpan="2" /> 
            <Border BorderBrush="White" BorderThickness="0,0,1,1" CornerRadius="5" Margin="5,5,5,25" Grid.ColumnSpan="2" /> 
            <Border BorderBrush="Black" BorderThickness="1,1,0,0" CornerRadius="5" Margin="5,5,5,25" Grid.ColumnSpan="2">  
 
                <telerikGrid:RadGridView x:Name="PacketRadGridView" 
                    EnableColumnVirtualization="True"   
                    EnableRowVirtualization="True" 
                    AutoGenerateColumns="False"   
                      CanUserFreezeColumns="False"   
                     ItemsSource="{Binding ReceivedPackets}"   
                    IsReadOnly="True" 
                    DataLoadMode="Asynchronous"   
                                           
                    > 
 
                    <telerikGrid:RadGridView.Resources> 
 
 
                        <Style x:Key="CustomColorCellStyle" TargetType="{x:Type telerik:GridViewCell}">  
                            <Setter Property="Background" Value="{Binding Converter={StaticResource colorConverter}}">  
                            </Setter> 
                        </Style> 
 
                    </telerikGrid:RadGridView.Resources> 
 
                    <telerik:RadGridView.ChildTableDefinitions> 
                        <telerik:GridViewTableDefinition> 
                        </telerik:GridViewTableDefinition> 
                    </telerik:RadGridView.ChildTableDefinitions> 
                    <telerik:RadGridView.Columns> 
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding PacketName}" Header="Packet" /> 
 
                    </telerik:RadGridView.Columns> 
 
                    <telerik:RadGridView.HierarchyChildTemplate> 
                        <DataTemplate> 
                            <telerik:RadGridView   
                                x:Name="RadGridView1"   
                                CanUserFreezeColumns="False"   
                                AutoGenerateColumns="False"   
                                  
                                ItemsSource="{Binding Messages}"   
                                ShowGroupPanel="False"   
                                IsReadOnly="True" 
                                Loaded="RadGridView1_Loaded">  
                                <telerik:RadGridView.Columns> 
                                    <telerik:GridViewDataColumn UniqueName="Variable" DataMemberBinding="{Binding MessageName}" Header="Variable" /> 
                                    <telerik:GridViewDataColumn UniqueName="Value" CellStyle="{StaticResource CustomColorCellStyle}" DataMemberBinding="{Binding Value}" Header="Value"/>  
                                </telerik:RadGridView.Columns> 
                            </telerik:RadGridView> 
                        </DataTemplate> 
                    </telerik:RadGridView.HierarchyChildTemplate> 
 
 
                </telerikGrid:RadGridView> 
 
 
 
            </Border> 
 
            <Popup x:Name="packetPopup" StaysOpen="False" Width="300" Height="300"   
             Placement="Mouse" Closed="packetPopup_Closed">  
                <Border BorderBrush="#FF3F509D" BorderThickness="5,5,3,3">  
                    <Grid Background="White">  
                        <Grid.RowDefinitions> 
                            <RowDefinition Height="*" /> 
                            <RowDefinition Height="10" /> 
                        </Grid.RowDefinitions> 
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="*" /> 
                            <ColumnDefinition Width="10" /> 
                        </Grid.ColumnDefinitions> 
 
                        <telerikNavigation:RadTreeView   
                            SelectionMode="Extended"   
                            IsLineEnabled="True"   
                            ItemsOptionListType="CheckList"   
                            IsOptionElementsEnabled="True"   
                            IsRootLinesEnabled="True"   
                            IsTriStateMode="True" 
                              
                            ItemsSource="{Binding PacketDefinitions}"   
                            ItemTemplate="{StaticResource PacketInfo}"   
                            ExpanderStyle="{StaticResource Expander}"   
                            Checked="RadTreeView_Checked"   
                            Unchecked="RadTreeView_Checked"   
                            telerikAnimation:AnimationManager.IsAnimationEnabled="False"   
                            ScrollViewer.HorizontalScrollBarVisibility="Auto"   
                            ScrollViewer.VerticalScrollBarVisibility="Auto"   
                            ItemContainerStyle="{StaticResource BindingsCollection}"/>  
 
 
                        <Thumb Grid.Row="0" Grid.Column="1"   
                Cursor="SizeWE" 
                Style="{StaticResource PopupThumb}"/>  
                        <Thumb Grid.Row="1" Grid.Column="0"   
                Cursor="SizeNS" 
              Style="{StaticResource PopupThumb}"/>  
                        <Thumb Grid.Row="1" Grid.Column="1"   
                Cursor="SizeNWSE" 
              Style="{StaticResource PopupThumb}"/>  
                    </Grid> 
                </Border> 
            </Popup> 
 
 
        </Grid> 
          
    </ContentControl> 
 
</UserControl> 
 
I have the above user control it is bound to an Items Control which has an ItemsPanelTemplate of type Canvas.  I am able to drag and drop the user control around the canvas but when I try resize the user control using the resize thumb, the user control goes into drag mode.  I have tried moving the  telerikDragDrop:RadDragAndDropManager.AllowDrag="True"  to inner controls but then the User Control will not drag on the Canvas.  How can I have a drag-able User Control that is also re-sizable?
Here is the code for the the Items control:
<Grid> 
        <ItemsControl x:Name="WidgetItemsControl"  ItemsSource="{Binding WidgetViews}"  Margin="5" > 
                 
                <ItemsControl.ItemsPanel> 
                      
                    <ItemsPanelTemplate> 
                        <Canvas  x:Name="WidgetCanvas" Background="#303030" Width="Auto" Height="Auto" ClipToBounds="True" telerikDragDrop:RadDragAndDropManager.AllowDrop="True"  > 
                            <Canvas.ContextMenu> 
                                <ContextMenu Name="WidgetContextMenu">  
                                    <MenuItem Command="{Binding NewWidgetCommand}" Header="{x:Static p:Resources.NewWidget}" Icon="{StaticResource NewImage}" InputGestureText="{x:Static p:Resources.ControlW}" /> 
                                </ContextMenu> 
                            </Canvas.ContextMenu> 
 
                </Canvas> 
                    </ItemsPanelTemplate> 
                  
                </ItemsControl.ItemsPanel> 
 
        <ItemsControl.ItemContainerStyle> 
            <Style> 
                <Setter Property="Canvas.Left" Value="{Binding Left}" /> 
                <Setter Property="Canvas.Top" Value="{Binding Top}" /> 
            </Style> 
        </ItemsControl.ItemContainerStyle> 
 
 
    </ItemsControl> 
         
    </Grid> 

Thanks for your help!

Steve Burns
Steve
Top achievements
Rank 1
 answered on 10 Mar 2010
3 answers
124 views

Hello....

I am currently working with a grouped RadGridView in which I must add three Sum AggregateFunctions.

The code that I use to do this is the following

radGridInvoiceDetails.ItemsSource = null;
if (CurrentMaster != null)
{
    var collection = from d in dc.InvoiceDetails
                     where d.IdInvoiceMaster == CurrentMaster.Id
                     orderby d.IdProductType, d.ProductDescription, d.BillNumber
                     select d;
                    
    radGridInvoiceDetails.ItemsSource = collection.ToList();
}

GroupDescriptor descriptor = new Telerik.Windows.Data.GroupDescriptor();

descriptor.Member = "ProductFamilyDescription";
descriptor.SortDirection = ListSortDirection.Ascending;
radGridInvoiceDetails.GroupDescriptors.Add(descriptor);

descriptor = new Telerik.Windows.Data.GroupDescriptor();
descriptor.Member = "ProductDescription";
descriptor.SortDirection = ListSortDirection.Ascending;

var sumFunction = new Telerik.Windows.Data.SumFunction();
sumFunction.ResultFormatString = "{0:N2}";
sumFunction.SourceField = "ProductQuantity";
sumFunction.Caption = "Totale Quantità";
descriptor.AggregateFunctions.Add(sumFunction);

sumFunction = new Telerik.Windows.Data.SumFunction();
sumFunction.ResultFormatString = "{0:N2}";
sumFunction.SourceField = "TotalBill";
sumFunction.Caption = "Totale Imponibile";
descriptor.AggregateFunctions.Add(sumFunction);

sumFunction = new Telerik.Windows.Data.SumFunction();
sumFunction.ResultFormatString = "{0:N2}";
sumFunction.SourceField = "TotalVAT";
sumFunction.Caption = "Totale Con IVA";

descriptor.AggregateFunctions.Add(sumFunction);

radGridInvoiceDetails.GroupDescriptors.Add(descriptor);

The result of this is wonderful but it takes up to 90 seconds to load less than 1500 records.

I have read something about QueryableCollectionView but I did not find enough to understand if and how it can help me.

Is there any suggestion to spend less time to have the same result??

Thanks a lot in advance...

Nick

Vlad
Telerik team
 answered on 10 Mar 2010
10 answers
137 views
Hi,
I have a simple app very similar to the carousel demo (First look), the app was working fine with 2009 Q2, but  after upgrade to 2009 Q3, the app throws the following error:

System.Reflection.TargetInvocationException was unhandled
  Message="Exception has been thrown by the target of an invocation."
  Source="mscorlib"
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       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.Application.RunInternal(Window window)
       at CuiraWPF.App.Main() in D:\projects2\own\XMPP messenger\client\Cuira\CuiraWPF\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       Message="Added item does not appear at given index '3'."
       Source="PresentationFramework"
       StackTrace:
            at System.Windows.Data.ListCollectionView.AdjustBefore(NotifyCollectionChangedAction action, Object item, Int32 index)
            at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
            at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 506
            at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 725
            at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 32
            at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
            at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 482
            at Telerik.Windows.Data.QueryableCollectionView.RefreshAndRaiseCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 557
            at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 640
            at Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 631
            at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 32
            at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
            at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
            at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
            at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
            at System.Collections.ObjectModel.Collection`1.Add(T item)
            at CuiraWPF.Code.MessengerHelper.<>c__DisplayClass17.<Connection_OnRosterItem>b__13() in D:\projects2\own\XMPP messenger\client\Cuira\CuiraWPF\Code\MessengerHelper.cs:line 305
       InnerException: 

The code line 305 is just a : ContactList.Add(current);

Any clues?

Additional information:
I found a temp fix:
I have an event handler that is listening when the collection changes, every time the observable collection is changed, it is reordered, I created a class that inherits from ObservableCollection, I have used that class on Silverlight with your components and it works fine, as I mentioned, the code works fine with Q2 and WPF, my temp solution was to comment the sort code and its working now, not the way that I need, but at least is displaying data.

Pedro
Top achievements
Rank 1
 answered on 10 Mar 2010
1 answer
69 views
Hello:

 In a chart of HorizontalBarSeriesDefinition, the SeriesItemLabel are over bar of right to left.  I need this label of left to right ( label must be out of the bar). I used the style  over SeriesItemLabel with margin = {20,0,0,0}. However, the value is dynamic and continuously over the bar


 have you some solution?
Dwight
Telerik team
 answered on 10 Mar 2010
2 answers
288 views
<Window x:Class="WpfApplication6.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" 
        Title="MainWindow" Height="350" Width="525"
        <DockPanel> 
            <telerik:RadButton Content="{Binding ElementName=_slider, Path=Value}" ContentStringFormat="{}{0:p0}" VerticalAlignment="Center" HorizontalContentAlignment="Center" MinWidth="50" BorderBrush="Transparent" BorderThickness="0" Background="Transparent"/> 
            <telerik:RadSlider x:Name="_slider" HandlesVisibility="Visible" VerticalAlignment="Center" Minimum="0.1" EnableSideTicks="True" TickFrequency="0.1" IsSnapToTickEnabled="True" Maximum="4" Value="1"/> 
        </DockPanel> 
</Window> 
Making the RadButton a WPF Button produces the proper "100%" string (en-US culture).  The RadButton produces "1"
This seems to me to be a bug.
Ivan
Telerik team
 answered on 10 Mar 2010
1 answer
168 views
I have the following scenario

I have an ItemsCollection in which the ItemsSource is bound to an observablecollection of DataTables. These datatables are dynamically generated at runtime.

When the grid is loaded I want to loop through each of the cells and set a tooltip and background color of the cell based on some condition.

How can I do this?

Thanks,

Billy Jacobs
StevenDale
Top achievements
Rank 2
 answered on 09 Mar 2010
1 answer
40 views
hi,
we want to show all opened panes in panegroup on the leftside.it is urgent
please help me. 
Konstantina
Telerik team
 answered on 09 Mar 2010
4 answers
589 views
I just downloaded the source codes for WPF RadControls in order to comply with the document titled "Technical guidelines for protecting Telerik RadControls for Silverlight binaries when redistributed with other applications". However, I can't find the "source code building instructions" that is supposed to have been bundled within the ZIP File. I tried opening the WPF solution directly from VS.NET 2008 but I got several "Project Inaccessible" and other build errors when i tried to rebuild the solution.

please advise.

thanks!
Milan
Telerik team
 answered on 09 Mar 2010
0 answers
104 views
Hi,
DevEx has a nice feature called Expression columns for their grid with expression editor. One can use the expression editor to create an expression for a column run time.
Is there anything like that available for RadGridView either in Beta or in the current release version?
thanks
Nick
Nick Polyak
Top achievements
Rank 1
 asked on 09 Mar 2010
1 answer
64 views
Hi,
i have a gridview with checkboxcolumns (set as controltemplates) like this one:
<telerik:GridViewDataColumn  x:Name="colReview" Header="Review Needed?" DataMemberBinding="{Binding IsReviewNeeded}">
                                    <telerik:GridViewDataColumn.CellStyle >
                                        <Style TargetType="GridView:GridViewCell">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="GridView:GridViewCell">
                                                        <Border x:Name="PART_CellBorder" Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0,0,1,1" BorderBrush="Silver">                                                            
                                                            <CheckBox Tag="CheckSecurity#AssayDialogPlates_Review" x:Name="PART_ContentPresenter" Margin="5,0,0,0"
                                                                HorizontalAlignment="Left"
                                                                VerticalAlignment="Center"
                                                                IsChecked="{Binding IsReviewNeeded, Mode=TwoWay}" />
                                                        </Border>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </telerik:GridViewDataColumn.CellStyle>                                    
                                </telerik:GridViewDataColumn>

and the grid have the CellValidating-Event. For each other cell, the CellValidating-Event is fired but not for the checkbox-Columns. Any suggestions? I need to use the columns this way!
Thx
Nedyalko Nikolov
Telerik team
 answered on 09 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?