Telerik Forums
UI for WPF Forum
3 answers
179 views

I'm using the MVVM pattern for my application.

 

Is it possible to bind the SortDescriptors collection of a RadGridView to a list in my viewmodel, and if so how do I do that?

 

Creating a property of type SortDescriptionCollection in my viewmodel is easy, but I don't know how to bind the gridview to that.

 

Thanks // David

Yavor Georgiev
Telerik team
 answered on 25 Oct 2010
9 answers
181 views
Hi,

When I create one line series, the zoom and scroll work fine.
However, when I add more line series and try to zoom in, the series behave weird. Parts of the lines disappear and they don't actaully look like they're zoomed in.

Is there a limitation to implementing zoom on only one series? Or am I doing something wrong?


Thanks in advance.
Ves
Telerik team
 answered on 25 Oct 2010
2 answers
125 views
I want the images to traverse in a liner path, like an image gallery.
How to define the path?
Vanya Pavlova
Telerik team
 answered on 25 Oct 2010
24 answers
455 views
Hello, it's been hours since I've tried and searched for any samples that implements hierarchical data using Linq to SQL. It says in your feature product that it automatically detects hierarchy relationship. Could you please provide a tutorial on how to implement or bind a datacontext to the datatemplate of my hierarchychildtemplate? 

And, i currenty coded
void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            
            m_dcData = new DataAccessDataContext();
            m_dcData.Log = Console.Out;
            rgvData.ItemsSource = m_dcData.Orders;
 
        }


And I tried to commenting out rgvData.ItemsSource = m_dcData.Orders and tried Binding the Linq to SQL class to xaml but I failed. How do I bind a Linq to SQL Class in xaml file so that in my second hierarchical data grid it shows the table that is related to the parent node?
<Grid>
        <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" />
        <telerik:RadGridView x:Name="rgvData" CanUserFreezeColumns="False" GridLinesVisibility="Horizontal" ItemsSource="" IsReadOnly="True" AutoGenerateColumns="False">
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding OrderDate}" Header="Order Date" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding EmployeeID}" Header="Employee" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Freight}" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCountry}" Header="Ship Country" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ShipCity}" Header="Ship City" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridView1" CanUserFreezeColumns="False" AutoGenerateColumns="False" ShowGroupPanel="False" IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}" Header="Customer ID" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Address}" Header="Address" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding City}" Header="City" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Country}" Header="Country" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
    </Grid>

Thanks!
Yavor Georgiev
Telerik team
 answered on 25 Oct 2010
5 answers
108 views
I have time series data that has gaps on holidays and weekends that must be omitted from the charts.  I am fine indexing the dates, that actually works good for me.  What I need to do is replace the index that is present on the X axis with the date it represents.  I have not found how to do this on the WPF charting controls.

Thanks!
Ves
Telerik team
 answered on 25 Oct 2010
1 answer
76 views

Hi
I have a data table which contain round about 25 columns but i just want to show the 10 columns out of those in the RAD Carousel Control. Can you please guide me on how can i  achieve this functionality

Vlad
Telerik team
 answered on 25 Oct 2010
3 answers
108 views
Hi,
is it possible to have some kind of automatic page scrolling, so that the last added item is always visible?

I mean, while the software continues to add items, and the items reach the bottom of the grid, then you can't see the new items added unless you continuously scroll down *each new item added*!
The behaviour I want is that the grid automatic scroll down, letting the last item inserted to stay visible at the bottom of the page: is thi possible?

Thanks
Vlad
Telerik team
 answered on 25 Oct 2010
3 answers
113 views
when I MultipleSelect userContorl   or RadGridView Multiple Select rows  is   error  System.NullReferenceException

please help me : 
error message

"   in System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()\r\n 
in System.Windows.Automation.Peers.AutomationPeer.GetChildren()\r\n  
in System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
in System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.ValidateConnected(AutomationPeer connectedPeer)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.AutomationPeerFromInputElement(IInputElement focusedElement)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.RaiseFocusChangedEventHelper(IInputElement newFocus)\r\n
在 System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)\r\n
在 System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)\r\n
在 System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)\r\n
在 System.Windows.Input.KeyboardDevice.Focus(IInputElement element)\r\n 
在 System.Windows.UIElement.Focus()\r\n 
在 Telerik.Windows.Controls.GridView.EditContext.OnCellMouseDown(GridViewCell cell)
位置 c:\\Builds\\WPF_Scrum\\Release_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\Editing\\EditContext.cs
:line 292\r\n
在 Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e)
位置 c:\\Builds\\WPF_Scrum\\Release_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\Cells\\GridViewCell.cs:行号 370\r\n
在 System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)\r\n
在 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n
在 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)\r\n 
在 System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)\r\n 
在 System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)\r\n
在 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n 
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)\r\n
在 System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)\r\n
在 System.Windows.Input.InputManager.ProcessStagingArea()\r\n 
在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)\r\n
在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)\r\n
在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)\r\n 
在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n  
在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\r\n
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)\r\n
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)\r\n 
在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)\r\n 
在 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)\r\n  
在 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)\r\n 
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n  
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)\r\n 
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)\r\n
在 System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)\r\n
在 System.Windows.Threading.Dispatcher.Run()\r\n 
在 System.Windows.Application.RunDispatcher(Object ignore)\r\n 

Yordanka
Telerik team
 answered on 25 Oct 2010
3 answers
64 views
Hi

when clicking on Automatic in the ColorPicker control included in my xaml as follows:

<telerik:RadColorPicker SelectedColorChanged="RadColorPicker_SelectedColorChanged" Tag="Foreground" Margin="5 0 5 0"/>

a System.NullReferenceException is thrown.

Sincerely.
Viktor Tsvetkov
Telerik team
 answered on 25 Oct 2010
1 answer
224 views
I have a listbox that shows dates, when a user clicks on a specific date I want it to become editable. So when I click on the listbox item, a trigger switches its datatemplate from a template containing a textblock to a template containing a RadDatePicker.

When this occurs, the RadDatePicker immediatley updates the binding source with the value.  Why is this?  The WPF Toolkit date picker does not do this, but I'd have to use the RadDatePicker.

Because I am using entity framework self tracking entities, this immediatley marks the entity I've bound to as modified.

Does anyone know a way to stop the RadDatePicker updating the binding source as soon as it appears on a datatemplate?

I've recreated this problem in a test window.  The XAML looks like this:

<Window x:Class="RadDatePickerInTemplate.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <DataTemplate x:Key="ViewTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Title}" />
                <TextBlock Text="{Binding Path=Date}" />
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="EditTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBox Text="{Binding Path=Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                <telerik:RadDatePicker SelectedDate="{Binding Path=Date, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            </StackPanel>
        </DataTemplate>
        <Style x:Key="ContainerStyle" TargetType="{x:Type ListBoxItem}">
            <Setter Property="ContentTemplate" Value="{StaticResource ViewTemplate}"/>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="ContentTemplate" Value="{StaticResource EditTemplate}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid>
        <ListBox x:Name="MyListBox"
                 IsSynchronizedWithCurrentItem="True" 
                 ItemContainerStyle="{StaticResource ContainerStyle}" />
    </Grid>
</Window>

... and the .cs looks like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
  
namespace RadDatePickerInTemplate
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
  
            // Show a list of Dates
            MyListBox.ItemsSource = new List<ListItem>()
            {
                new ListItem() { Title = "Test 1", Date = new DateTime(2010, 3, 27) },
                new ListItem() { Title = "Test 2", Date = new DateTime(2010, 8, 19) },
                new ListItem() { Title = "Test 3", Date = new DateTime(2010, 2, 3) }
            };
        }
    }
  
    public class ListItem
    {
        public string Title { get; set; }
  
        private DateTime _date;
        public DateTime Date
        {
            get { return _date; }
            set
            {
                // Set a breakpoint here once the form is displayed, 
                // clicking a listbox row will immediatley break here
                _date = value;
            }
        }
    }
}

Thanks for any help!
Simon.
Kaloyan
Telerik team
 answered on 25 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?