Telerik Forums
UI for WPF Forum
6 answers
254 views
Hi,

Is it possible to bind to an array of arrays?

We need to bind to some dynamic data, so we cannot pre-generate classes for the data items.


Craig
Kristjan Einarsson
Top achievements
Rank 1
 answered on 08 Mar 2012
7 answers
236 views
Hello telerik team,

I get an System.FormatException when i scroll up or down with my mousewheel in my numeric GridViewMaskedTextBoxColumn cell.

Can you confirm this problem?

My WpfControls Version is 2011.3.1220.40 .
Tina Stancheva
Telerik team
 answered on 08 Mar 2012
2 answers
103 views
I have a large-ish drag cue, and I need to be quite precise about where the drop is going to happen (it's into a RadRichTextBox, so position in the text is important).

Is there any way I can control the position of the drag cue?  At present, the mouse pointer is somewhere in the middle of the control I'm using.  It appears it does something similar in most of the demos, too.  I would like the cue to be drawn with the top left (0,0) starting at the mouse pointer position - then I'd be able to see what is under the mouse pointer.

Any help appreciated!
Nick
Telerik team
 answered on 08 Mar 2012
11 answers
347 views
I have a screen which has a Gridview and 2 heirarchies within it.

At the moment, I am using the RowEditEnded event of the GridView (and its embedded Grids) to perform updates. I am doing it in such a way which is not very MVVM. For example:
private void TasksRadGridView_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
{
    Task updatedTask = e.NewData as Task;
    ManageProjectsViewModel vm = this.DataContext as ManageProjectsViewModel;
    vm.UpdateTaskCommand.Execute(updatedTask);
}

You can see there that I am casting the DataContext as a ViewModel.
I would prefer to bind directly to properties on the ViewModel in Xaml.

The current Xaml for that UserControl is:
<UserControl x:Class="TimeTracker.View.ManageProjectsView.ManageProjectsView"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             DataContext="{Binding ManageProjects, Source={StaticResource Locator}}">
     
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
 
    <Grid>
        <!-- This Border is just a container to provide the transparent effect as a layer above the clock-->
        <Border Grid.Row="1" Height="Auto" Width="Auto">
            <Grid Height="Auto" Width="Auto" Background="#990D0529">
                <Border Padding="10" Margin="0" Width="630" Height="600" CornerRadius="10" BorderBrush="#FF3F3636"
                BorderThickness="1" Background="{StaticResource TransparentBrush}">
                    <Border Padding="10" Height="450" Width="580" CornerRadius="10" BorderBrush="#FF3F3636" BorderThickness="1" Background="{StaticResource TransparentBrush}">
                        <Grid Height="Auto" Width="Auto" Background="#990D0529">
 
                            <telerik:RadGridView x:Name="ProjectsRadGridView" AutoGenerateColumns="False"
                                                 ColumnWidth="*" GridLinesVisibility="None" telerik:StyleManager.Theme="Transparent"
                                                 RowIndicatorVisibility="Collapsed" IsReadOnly="False"
                                                 ItemsSource="{Binding Path=Projects}"
                                                 RowEditEnded="ProjectsRadGridView_RowEditEnded">
 
                                <telerik:RadGridView.ChildTableDefinitions>
                                    <telerik:GridViewTableDefinition />
                                </telerik:RadGridView.ChildTableDefinitions>
 
                                <telerik:RadGridView.Columns>
                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Project Id" UniqueName="Id" IsVisible="False" />
                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding ProjectName}" Header="Name" UniqueName="ProjectName" IsReadOnly="False"/>
                                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Visible}" Header="Visible" UniqueName="Visible" IsReadOnly="False" />
                                </telerik:RadGridView.Columns>
 
                                <telerik:RadGridView.HierarchyChildTemplate>
                                    <DataTemplate>
                                        <telerik:RadGridView x:Name="TasksRadGridView" BorderThickness="0,1,0,1"
                                                             telerik:StyleManager.Theme="Transparent"
                                                             RowEditEnded="TasksRadGridView_RowEditEnded"
                                                             GridLinesVisibility="None" CanUserFreezeColumns="False"
                                                             AutoGenerateColumns="False" ItemsSource="{Binding Tasks}" 
                                                             ShowGroupPanel="False" IsReadOnly="False">
                                                 
                                            <telerik:RadGridView.ChildTableDefinitions>
                                                <telerik:GridViewTableDefinition />
                                            </telerik:RadGridView.ChildTableDefinitions>
 
                                            <telerik:RadGridView.Columns>
                                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Task ID" IsVisible="False" />
                                                <telerik:GridViewDataColumn DataMemberBinding="{Binding TaskName, UpdateSourceTrigger=PropertyChanged}" Header="Name" />
                                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" />
                                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Visible}" Header="Visible" />
                                            </telerik:RadGridView.Columns>
 
                                            <telerik:RadGridView.HierarchyChildTemplate>
                                                <DataTemplate>
                                                    <telerik:RadGridView x:Name="WorkItemsRadGridView" BorderThickness="0,1,0,1"
                                                             telerik:StyleManager.Theme="Transparent"
                                                             RowEditEnded="WorkItemsRadGridView_RowEditEnded"
                                                             GridLinesVisibility="None" CanUserFreezeColumns="False"
                                                             AutoGenerateColumns="False" ItemsSource="{Binding WorkItems}" 
                                                             ShowGroupPanel="False" IsReadOnly="False">
                                                        <telerik:RadGridView.Columns>
                                                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}" Header="Work Item ID" IsVisible="False" />
                                                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Duration}" Header="Duration" IsReadOnly="False" />
                                                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description" IsReadOnly="False" />
                                                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DateOfWork}" Header="DateOfWork" IsReadOnly="False" />
                                                        </telerik:RadGridView.Columns>
                                                    </telerik:RadGridView>
                                                </DataTemplate>
                                            </telerik:RadGridView.HierarchyChildTemplate>
 
                                        </telerik:RadGridView>
                                    </DataTemplate>
                                </telerik:RadGridView.HierarchyChildTemplate>
                            </telerik:RadGridView>
 
                        </Grid>
                    </Border>
                </Border>
            </Grid>
        </Border>
    </Grid>
 
</UserControl>


I think one part of the problem is that the embedded Grids are not binding to separate ViewModels. They are binding to the relevant property on the ViewModel:
e.g. the 1st embedded GridView is TasksRadGridView. It binds as so:
ItemsSource="{Binding Path=Projects}"
    

Is there a way to directly binding to the ViewModel, passing it the valie of the current ro being edited for the embedded grids?
I am familiar with the EventToCommand trigger of the MVVM Light Toolkit. I just can't find a way to extract the value for the current row being edited for items in the embedded Grids. The item would be sent as a parameter using the EventToCommand trigger (I think that is the best design).

Cheers

Cheers
Rayne
Top achievements
Rank 1
 answered on 08 Mar 2012
5 answers
94 views
Hello. I have added a CheckBox to a GridView. I need to be able to check and un-check this CheckBox w/o editing the row. I have seen examples where the CheckBox is checked when the row is clicked but this is not what I am after.

Thanks in advance.
Dimitrina
Telerik team
 answered on 08 Mar 2012
1 answer
124 views
Hello,

It seems there is an issue with ColumnWidth property being speficied as a Style property for the RadGridView.  Here is my code

<Window x:Class="GridTest.MainWindow"
        Title="MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Window.Resources>
        <Style TargetType="{x:Type telerik:RadGridView}">
            <Setter Property="ShowGroupPanel"   Value="False"/>
            <Setter Property="ColumnWidth" Value="*"></Setter>
        </Style>
         
    </Window.Resources>
    <Grid Margin="40">
        <telerik:RadGridView  Name="gridViewCheckBox1" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Qtr1"  DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr2" DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr3"  DataMemberBinding="{Binding FinancialQuarter}" />
                <telerik:GridViewDataColumn Header="Qtr4"  DataMemberBinding="{Binding FinancialQuarter}" />
            </telerik:RadGridView.Columns>
 
        </telerik:RadGridView>
    </Grid>
</Window>

The ShowGroupPanel="false" applies to the grid but I don't see the columns occupying all of the Grid's Width. Is this an existing bug of RadGridView?  Any help is appreciated.
Attached is the image of my output.

Note: It works when I specify this property explicitly for each of the RadGridView but not as a part of Style (either as a local resource/Window Resource/ ResourceDictionary)
Vera
Telerik team
 answered on 08 Mar 2012
1 answer
127 views
Basically I created a dynamic object, it can be an ExpandoObject or any object that inherits from the DynamicObject class, and assign several properties and their associated values to the object.  I then set the editor's Item equal to that object.  The property Fields was able to list all the object's properties just fine, but as soon as I select one of the property, the editor immediately underlines the property name which indicates an error.  The error message appears in the tooltips stated "The [name of selected property] is not a member of type System.Dynamic.ExpandoObject" when I hover over the text.  I'm using Q2 2011 edition.

Thanks in advance for your reply. 
Vlad
Telerik team
 answered on 08 Mar 2012
3 answers
113 views
Hello

I did upgraded all DLLs in the install-folder und changed the version-entry in all *.csproj files that i use. Now, I have massive problems to use the RadDocking.
I can complie the programm and it starts, too. But when I try to move a Pane an NullReferenceException will thrown.
All components (RadSplitContainer, RadGroups, RadPane and RadDocumentPane) are created by code, just the RadDocking is defiend in XAML.

I tried to build a Exsample  and I get allmost the same error

important is Application_Startup I need to create the MainWindow at this position!
If StyleManager.ApplicationTheme is assined than an exception will thrown when a Pane add to RadDocking .


public partial class App : Application
{
    private void Application_Startup(object sender, StartupEventArgs e)
    {
 
        StyleManager.ApplicationTheme = new Office_BlueTheme();
 
        this.MainWindow = new MainWindow();
        this.MainWindow.Show();
    }
}


public partial class MainWindow : RadRibbonWindow
{
    public MainWindow()
    {
        this.WindowState = WindowState.Maximized;
        InitializeComponent();
    }
 
 
    private void AddNewToolDocPane()
    {
        var container = Docking.DocumentHost as RadSplitContainer;
        if (container == null)
        {
            container = new RadSplitContainer() { InitialPosition = DockState.DockedBottom };
            Docking.DocumentHost = container;
        }
        var paneGroup = container.Items.OfType<RadPaneGroup>().FirstOrDefault();
        if (paneGroup == null)
        {
            paneGroup = new RadPaneGroup();
            container.Items.Add((paneGroup));
        }
 
        var pane = new RadPane();
        paneGroup.AddItem(pane, DockPosition.Center);
    }
 
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        AddNewToolDocPane();
    }
}

<telerik:RadRibbonWindow x:Class="WpfApplication2.MainWindow"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <StackPanel>
            <Button Content="test" Click="Button_Click"/>
        </StackPanel>
        <telerik:RadDocking Grid.Row="2" x:Name="Docking" BorderThickness="0" Padding="0" >
        </telerik:RadDocking>
    </Grid>
</telerik:RadRibbonWindow>


Boyan
Telerik team
 answered on 08 Mar 2012
1 answer
283 views
I need to be able to add a Custom Label to a Radial Gauge that will contain text indicating the status of the value being presented.  I am using the WPF Q2 2011 gauges and because of a time crunch I will not be able to upgrade the gauges to a newer version.  I know that the next version of gauge has this ability.  Please if anyone knows how to add a text label as indicated I need to know this quickly.  Thank you for your time and consideration on this question.

James
Andrey
Telerik team
 answered on 08 Mar 2012
0 answers
79 views
Hi everyone,

I'm working with the gridview. I'm trying to add a new row directly in the grid.
I have predefined columns , with the following types

Column1                        Column2                        Column 3                                Column4
GridViewDataColumn    GridViewDataColumn     GridViewComboBoxColumn    GridViewDataColumn

what i want to do is  that on the RowEditEnded, i check if it is an insert....and insert the record in the database.
When i enter data in the 1st column and press tab, it moves to the next, i add data to column2 and press tab , it moves to the 3rd column. From the 3rd column when i select something from the combo box and press tab to move to column 4, it fires the RowEditEnded event !!!! I was expecting this event to be fired on presseing tab on 4th column.

Why does a column with combo box triggers the roweditended.????

Anyone has noticed this behaviour before ?

Your helps and suggestions are most welcome

Regards,
Shaimaa
Shaimaa
Top achievements
Rank 1
 asked on 08 Mar 2012
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?