Telerik Forums
UI for WPF Forum
1 answer
74 views
I have a radcarousel bound to an objectdataprovider which has an instance of an observablecollection<T> where T is a personentity class in my system. If I change a property value of one of the personentity (like firstname) those changes are not reflected in the Carousel. Any help will be much appreciated.

Matt Francis
Top achievements
Rank 1
 answered on 26 Jan 2009
3 answers
223 views
Hello,

I'm having an issue where the column header is missing when you add a column to the grid after it has initially been created.  I have created a sample project that demonstrates my issue, but it appears I can't attach it so I included the code at the end of this post.  To reproduce it, just click on the 'Add Column' button.  Am I doing something wrong in my code or is this a bug?

In my example I'm also calling Rebind() and UpdateLayout() on the grid after adding the column because if I don't then no data appears in the column, though the column itself is added.

Note: I borrowed the Custom and Order classes from a sample app on this forum.

Thanks,

Joel


Window1.xaml
<Window x:Class="AddColumnIssue.Window1" 
    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="Window1" Height="380" Width="701"
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="30" /> 
            <RowDefinition Height="*" /> 
        </Grid.RowDefinitions> 
         
        <Button x:Name="AddColumnButton" Grid.Row="0" Height="23" Width="75" Click="AddColumnButton_Click" >Add Column</Button> 
         
        <telerik:RadGridView x:Name="ItemsGrid" Grid.Row="1" ItemsSource="{Binding}" AutoGenerateColumns="False" /> 
    </Grid> 
</Window> 

Window1.cs
    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
            AddColumns(); 
            this.DataContext = BuildCustomers(); 
        } 
 
        private void AddColumnButton_Click(object sender, RoutedEventArgs e) 
        { 
            AddColumn(typeof(string), "Email", 200); 
            RefreshGrid(); 
        } 
 
        private void AddColumns() 
        { 
            AddColumn(typeof(int), "Number", 100); 
            AddColumn(typeof(string), "Name", 100); 
        } 
 
        private void AddColumn(Type dataType, string name, int width) 
        { 
            GridViewDataColumn column = new GridViewDataColumn(); 
            column.DataType = dataType; 
            column.HeaderText = name; 
            column.UniqueName = name; 
            column.Width = new GridLength(width); 
            column.IsReadOnly = true
 
            ItemsGrid.Columns.Add(column); 
        } 
 
        private void RefreshGrid() 
        { 
            ItemsGrid.Rebind(); 
            ItemsGrid.UpdateLayout(); 
        } 
 
        private static ObservableCollection<Customer> BuildCustomers() 
        { 
            ObservableCollection<Customer> customers = new ObservableCollection<Customer>(); 
            ObservableCollection<Order> orders = new ObservableCollection<Order>(); 
 
            for (int i = 0; i < 10; i++) 
                orders.Add(new Order { Number = i, Details = "Order" + i }); 
 
            for (int i = 0; i < 100; i++) 
                customers.Add(new Customer { Email = "Mail" + i, Name = "Name" + i, Number = i, Orders = orders }); 
 
            return customers; 
        } 
    } 

Milan
Telerik team
 answered on 26 Jan 2009
2 answers
162 views
Hi,

I'm trying to create a 3D Dougnut Chart, but are having troubles with the Series Mapping. Using the code below, I get the legend to show color coded items equal to the amount of rows in the table. But nothing else displays.

Doughnut3DSeriesDefinition definition = new Doughnut3DSeriesDefinition();  
 
definition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;  
 
radChart1.DefaultSeriesDefinition = definition;  
 
   
 
radChart1.DefaultView.ChartLegend.Header = "TEST DATA";  
 
SeriesMapping seriesMapping = new SeriesMapping();  
 
ItemMapping itemMapping = new ItemMapping();  
 
itemMapping.DataPointMember = DataPointMember.YValue;  
 
itemMapping.FieldName = "DoubleData";  
 
seriesMapping.ItemMappings.Add(itemMapping);  
 
ItemMapping itemMapping2 = new ItemMapping();  
 
itemMapping2.DataPointMember = DataPointMember.Label;  
 
itemMapping2.FieldName = "StringData";  
 
seriesMapping.ItemMappings.Add(itemMapping2);  
 
radChart1.SeriesMappings.Add(seriesMapping);  
 
DataTable tt = new DataTable();  
 
tt = GetDataTable();  
 
radChart1.ItemsSource = tt;  
 
 


 

Any help would be much appreciated. Not really sure how the charting works.

Thanks,

Henry

 

Velin
Telerik team
 answered on 26 Jan 2009
1 answer
137 views
Hi,

I am trying to implement pagination in griedview and somehow got success by using the following code

var page = GridViewItemsControl.GetVirtualizingPanel(GridView1.ItemsControl);
            page.PageDown();

But I want movenext, moveprevious, move first and move last functionalities. Moreover I wanted to display the current page number also.

Please help me to achive this solution.

Thanks!

Vaithi.



Victor
Telerik team
 answered on 26 Jan 2009
1 answer
64 views

Hello

I wanted to know:

1) When I open the demo project with VS 2008 Professional Edition with SP1, VS crashes.any ideas? I'm using vista sp1, + telerik 2008 q3. I tried running vs with admin but didn't help

2) What's the name of the left control in the demo app(which lists particular control's demos)? It looks like treeview, but I liked it's effects and want to use it in my application. Thanks.

Boyan
Telerik team
 answered on 26 Jan 2009
1 answer
290 views
Hi there !
I have one window control wich holds two grids( one wich will be static - with a banner ) and the other will have two different user controls ( one for the list case and the other for adding/ editing data ) . I am defining several commandbindings & keybinds in order to have a fully functional keyboard shortcut system . The problem appears when I use the RadNumericUpDown control . When I insert a decimal value or other, my window control looses the focus; I have compared the state of the focus before and after using the numericupdown and I can see that the window focus status change ( from true to false )... I guess this happens right when i use the numericupdown control ... Any ideia / suggestions ?

Thanks,
Ivan Frias

Boyan
Telerik team
 answered on 23 Jan 2009
6 answers
74 views
Hi,

I am getting an exception whenever I try to resize any column of an empty gridview. Is this a known issue?

Here are the exceptions details

System.ArgumentOutOfRangeException was unhandled
  Message="Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index"
  Source="mscorlib"
  ParamName="index"
  StackTrace:
       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       at System.ThrowHelper.ThrowArgumentOutOfRangeException()
       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at Telerik.Windows.Controls.GridViewColumnCollection.get_Item(Int32 index)
       at Telerik.Windows.Controls.GridViewColumnCollection.System.Collections.Generic.IList<Telerik.Windows.Data.IFieldDescriptor>.get_Item(Int32 index)
       at Telerik.Windows.Controls.GridViewColumn.OnColumnResizedByUser(Double horizontalChange)
       at Telerik.Windows.Controls.GridViewColumn.ResizeColumnWidth(Double HorizontalChange, Boolean resizedByUI)
       at Telerik.Windows.Controls.GridView.GridViewHeaderSplitter.GridViewHeaderSplitter_DragDelta(Object sender, DragDeltaEventArgs e)
       at System.Windows.Controls.Primitives.DragDeltaEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e)
       at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e)
       at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(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.WrappedInvoke(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 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Admin.Windows.Forms.App.Main() in E:\Abhishek\Projects\Development\Source\Admin\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:

Thanks,
akjoshi
Brandon
Top achievements
Rank 1
 answered on 21 Jan 2009
7 answers
171 views
Hi,

Where can I find more detailed samples of using various features of TreeView control, samples present in demo are not enough.

Regards,
akjoshi
Tihomir Petkov
Telerik team
 answered on 21 Jan 2009
1 answer
105 views

Hi,
I'm running WPF Controls, 2008.3, .NET 3.5 and VS 2008 SP1

When I add the following code into the XAML pane:

        <my:RadTabControl TabStripPlacement="Left" TabOrientation="Vertical"  Align="Left" Height="100" Name="radTabControl1" Width="200" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation">
            <my:RadTabItem Name="TwitterTab" Header="Twitter">

            </my:RadTabItem>

        </my:RadTabControl>

I get the following error in the designer:

Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.RadTabItem.OnTabOrientationChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\Silverlight\Telerik.Windows.Controls.Navigation\TabControl\RadTabItem.cs:line 767
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
   at Telerik.Windows.Controls.RadTabItem.set_TabOrientation(Orientation value) in r:\WPF_Scrum\WPF_Team\Sources\Development\Silverlight\Telerik.Windows.Controls.Navigation\TabControl\RadTabItem.cs:line 330
   at Telerik.Windows.Controls.RadTabControl.PrepareContainerForItemOverride(DependencyObject element, Object item) in r:\WPF_Scrum\WPF_Team\Sources\Development\Silverlight\Telerik.Windows.Controls.Navigation\TabControl\RadTabControl.cs:line 1312
   at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
   at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   at System.Windows.Controls.Panel.reGenerateChildren()
   at System.Windows.Controls.Panel.get_InternalChildren()
   at System.Windows.Controls.Panel.get_Children()
   at Telerik.Windows.Controls.Primitives.TabStripPanel.MeasureOverride(Size availableSize) in r:\WPF_Scrum\WPF_Team\Sources\Development\Silverlight\Telerik.Windows.Controls.Navigation\TabControl\TabStripPanel.cs:line 0
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at MS.Internal.WindowControl.DesignTimeWindow.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.SimpleViewManager.DesignerBackground.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize()
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content)
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle()
   at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()

How can I resolve this?

By the way, your code input window doesn't work very well in Chrome.
Boyan
Telerik team
 answered on 19 Jan 2009
2 answers
239 views
Hello,

Is there an event that is raised when a column is resized?  If not, do you have any suggestions about how to get notified whenever a column is resized?

Thanks,

Joel
JP
Top achievements
Rank 1
 answered on 19 Jan 2009
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?