Telerik Forums
UI for WPF Forum
1 answer
250 views
I have an issue with using a TimePicker inside my RadGridView.  Here's my XAML:

<telerik:GridViewDataColumn Header="Start Time" DataMemberBinding="{Binding SStartTime, Mode=TwoWay}"
                    <telerik:GridViewDataColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="{Binding SStartTime, Mode=TwoWay, Converter={StaticResource TimeStringConverter}}" /> 
                        </DataTemplate> 
                    </telerik:GridViewDataColumn.CellTemplate> 
                    <telerik:GridViewDataColumn.CellEditTemplate> 
                        <DataTemplate> 
                            <telerik:RadTimePicker SelectedTime="{Binding SStartTime, Mode=TwoWay}" StartTime="0:0:0" EndTime="23:0:0"/> 
                        </DataTemplate> 
                    </telerik:GridViewDataColumn.CellEditTemplate> 
                </telerik:GridViewDataColumn> 

So, everything is fine if I use the TimePicker to select the time using my mouse.  If I type a time in to the control and don't select the time with my mouse the underlying data is NOT updated (and on the TimePicker control this usually works fine).  Any thoughts?
Stefan Dobrev
Telerik team
 answered on 06 Apr 2010
4 answers
98 views
Hi,
can someone tell me how to make the following sample work (grouping by inner ID fails) without modifying the OuterElement-class (in real world that comes from a third-party)?
The problem seems to be that the grouping does not use the right runtime-type but the type of the property(which is an interface that is inherited by SpecialInnerElement). Have a look and you see what I mean.

xaml:
<Window x:Class="RadGridGroupingType.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" 
    xmlns:telerikdata="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data" 
    xmlns:sys="clr-namespace:System;assembly=mscorlib" 
    Title="Window1" Height="300" Width="300"
    <Grid> 
        <telerik:RadGridView Name="radgv" AutoGenerateColumns="False" ItemsSource="{Binding}"
            <telerik:RadGridView.Columns> 
 
                <telerik:GridViewDataColumn Header="outer ID" DataType="{x:Type sys:Int32}" GroupMemberPath="ID"
                    <telerik:GridViewColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="{Binding Path=ID}"/> 
                        </DataTemplate> 
                    </telerik:GridViewColumn.CellTemplate> 
                </telerik:GridViewDataColumn> 
 
                <telerik:GridViewDataColumn Header="inner ID" DataType="{x:Type sys:Int32}" GroupMemberPath="InnerElement.ID"
                    <telerik:GridViewColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="{Binding Path=InnerElement.ID}"/> 
                        </DataTemplate> 
                    </telerik:GridViewColumn.CellTemplate> 
                </telerik:GridViewDataColumn> 
 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 

code-behind:
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; 
using System.Collections.ObjectModel; 
 
namespace RadGridGroupingType 
    /// <summary> 
    /// Interaction logic for Window1.xaml 
    /// </summary> 
    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
 
            ObservableCollection<OuterElement> col = new ObservableCollection<OuterElement>(); 
 
            col.Add(new OuterElement() { ID = 1 }); 
            col.Add(new OuterElement() { ID = 2 }); 
            col.Add(new OuterElement() { ID = 3 }); 
 
            radgv.DataContext = col; 
        } 
    } 
 
    public class OuterElement 
    { 
        public int ID { getset; } 
 
        private SpecialInnerElement m_innerElement = new SpecialInnerElement() { ID = 99 }; 
 
        //public SpecialInnerElement InnerElement //returning the right runtimeType: grouping works 
        public IInnerElement InnerElement         //returning interface: grouping does not work 
        { 
            get { return m_innerElement; } 
        } 
    } 
 
    public interface IInnerElement 
    { 
        //"does not matter"; 
    } 
 
    public class SpecialInnerElement: IInnerElement 
    { 
        public int ID { getset; } 
    } 

Best Regards
Steffen
Steffen
Top achievements
Rank 1
Veteran
 answered on 06 Apr 2010
1 answer
144 views
I'm trying to create a menu that will stay open when the user clicks on any child items (see below).

<Menu>
<MenuItem StaysOpenOnClick="True" Header="MenuTitle1.0" >
<MenuItem StaysOpenOnClick="true" Header="Label">
<TextBox Text="TextBoxFiller" />
</MenuItem>
<MenuItem StaysOpenOnClick="true" Header="Menu1.1">
<telerik:RadColorSelector/>
</MenuItem>
<MenuItem StaysOpenOnClick="true" Header="Menu1.2">
<telerik:RadColorSelector />
</MenuItem>
</MenuItem>
</Menu>

While this seems to work for the textbox (sort of), when ever the user clicks on the RadColorSelector, the menu closes, despite setting the StaysOpenOnClick to "True". Thoughts?
Bobi
Telerik team
 answered on 06 Apr 2010
10 answers
149 views
Hello,

When I "upgrade" the controls to the 1412 version, specifically, Telerik.Windows.Data I receive the following error and I'm unable to view the window in design view.

Error 1 '/Microsoft.Windows.Design.Developer;component/themes/GridAdorners.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Cannot create instance of 'GenericTheme' defined in assembly 'Microsoft.Windows.Design.Interaction, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Exception has been thrown by the target of an invocation. Error at object 'ResourceDictionary_4'.


Please note I'm using Visual Studio 2008 SP1 and .NET 3.5 SP1.  This appears to be similar to an issue found in the WPF Toolkit - http://blogs.msdn.com/delay/archive/2010/01/19/sometimes-it-takes-a-village-to-solve-a-problem-workaround-for-a-visual-studio-2008-design-time-issue-with-the-wpf-toolkit-when-blend-3-is-installed.aspx.

I also have Blend 3 installed and the error doesn't happen in Blend.

Kind regards,

David

Brian Ensink
Top achievements
Rank 1
 answered on 05 Apr 2010
2 answers
233 views
I tried to set filters for the GridView but it crashes. The error is the following one :

Expression of type 'System.Object' cannot be used for parameter of type 'System.String' of method 'Boolean Contains(System.String)'




I'm not sure why, is the code wrong or something. See below, I tried adding a filter descriptor, both ways but doesn't work.

FilterDescriptor ofilter = new FilterDescriptor(); 
ofilter.Member = radGridView1.Columns["Type"].UniqueName; 
ofilter.Operator = FilterOperator.IsContainedIn; 
ofilter.Value = sMask.ToString(); 
radGridView1.FilterDescriptors.Add(ofilter); 
radGridView1.FilterDescriptors.Add(new FilterDescriptor("Type", FilterOperator.IsContainedIn, sMask)); 

I tried the same way as setting a sort in the rows and this one works well.

SortDescriptor descriptor = new SortDescriptor(); 
descriptor.Member = "Type"
descriptor.SortDirection = ListSortDirection.Ascending; 
radGridView1.SortDescriptors.Add(descriptor); 

Work around or sample code would be appreciated.
Thanks,
Siegfrid
Sieg
Top achievements
Rank 1
 answered on 05 Apr 2010
4 answers
137 views
First attempt to use the new control and I get an error I've never seen before (and apparently no one in the internet has either). What does it mean?

'TransitionProvider' type does not have a public TypeConverter class.



Art Kedzierski
Top achievements
Rank 2
 answered on 05 Apr 2010
5 answers
181 views
I'm a bid fed up with WPF databounding and is trying out the non-databound road :)

Probably me thats doing something wrong, But I get this error:
"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."

I modified your FirstLook example by adding this method to the codebehind:
        private void LB() 
        { 
            System.Data.DataTable dv = ExamplesDB.GetCustomers(); 
 
            foreach (System.Data.DataRow dr in dv.Rows) 
            { 
                radGridViewFirstLook.Items.Add(dr); 
            } 
        } 

And removing the DataContext and ItemSource setters in the XAML file:
<QuickStart:ExampleControl x:Class="Telerik.Windows.Examples.GridView.FirstLook.Example" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:QuickStart="clr-namespace:Telerik.Windows.QuickStart;assembly=Telerik.Windows.QuickStart" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:e="clr-namespace:Telerik.Windows.Examples"
    <Grid> 
        <telerik:RadGridView Name="radGridViewFirstLook" ColumnsWidthMode="Fill" AutoGenerateColumns="False" Margin="0,0,-1,0"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}"  HeaderText="Customer ID" UniqueName="CustomerID" /> 
                <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Company Name" UniqueName="CompanyName" /> 
                <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Country" UniqueName="Country" /> 
                <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="City"  UniqueName="City" /> 
                <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Contact Name"  UniqueName="ContactName" /> 
                <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Bool" UniqueName="Bool" /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
        <telerik:RadPanelBar Height="6" Margin="232,0,284,-330" Name="radPanelBar1" VerticalAlignment="Bottom" /> 
    </Grid> 
</QuickStart:ExampleControl> 

Why isn't this working - I'm not using ItemsSource?





Rossen Hristov
Telerik team
 answered on 05 Apr 2010
1 answer
123 views
I want to do the following using the DataGrid view

1. Copy individual or multiple cells from the Grid, and paste to a text file
    -- When I try to do this, I am copying the whole row. I just want to copy one cell, or multiple cell. I want functionality similar to Excel
2. Copy contents of one or more cells and copy to a different section of the Grid
    -- I am not sure if the current control supports it or not. When I tried to do this on a sample Grid, it didn't work

Rossen Hristov
Telerik team
 answered on 05 Apr 2010
1 answer
71 views
Hello,

What is the quickest way to remove/style the transition animation that occurs when shifting focus from one row to the next. It appears that there is an animation fading out the selected row colour, and we'd like to remove that.

Thanks
Kalin Milanov
Telerik team
 answered on 05 Apr 2010
1 answer
348 views
I would like to know if it is possible to set programmatically a tooltip in the GridViewSelectColumn´s checkcoxes.
Rossen Hristov
Telerik team
 answered on 05 Apr 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?