Telerik Forums
UI for WPF Forum
4 answers
126 views
Hi

I'm trying to get a custom hierarchy going in the new Q3 Gridview.  The examples don't explain how to do this properly (the example under Custom Hierarchy is actually a Property Hierarchy).

Here's how I did it in the previous version:

        public FailedMessagesView() 
        { 
            InitializeComponent(); 
            FailedFaxGrid.TableDefinition.PreviewDataRecordCreate += FailedFaxTableDefinition_PreviewDataRowCreate; 
        } 
 
        private void FailedFaxTableDefinition_PreviewDataRowCreate(object sender, DataRecordCreateEventArgs e) 
        { 
            FailedMessagesViewModel fmVM = (FailedMessagesViewModel)DataContext; 
            SuppliersEntity theSupplier = (SuppliersEntity)e.Data; 
            ObservableCollection<MessagesCheckedEntity> theMessages = new ObservableCollection<MessagesCheckedEntity>
                fmVM.FailedFaxes.Where(m => m.fkidSupplier == theSupplier.idSupplier).ToList()); 
            if (theMessages.Count > 0) 
            { 
                e.IsExpandableRecord = true
                GridViewTableDefinition ffDefs = new GridViewTableDefinition(); 
                ffDefs.AutoGenerateFieldDescriptors = false
                ffDefs.DataSource = theMessages
 
                GridViewDataColumn checkBox = new GridViewDataColumn(); 
                checkBox.Name = "FailedFaxCheckValName"
                checkBox.Header = " "
                checkBox.IsFilterable = false
                checkBox.IsGroupable = false
                checkBox.IsReadOnly = true
                checkBox.CellStyle = (Style)FailedFaxGrid.FindResource("checkValueStyle"); 
                checkBox.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(checkBox); 
 
                GridViewDataColumn JobNo = new GridViewDataColumn(); 
                JobNo.Name = "FailedFaxJobNoName"
                JobNo.Header = "Job"
                JobNo.IsFilterable = false
                JobNo.IsGroupable = false
                JobNo.IsReadOnly = true
                JobNo.DataMemberBinding = new Binding("DataRow[sgCommonName]"); 
                JobNo.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(JobNo); 
 
                GridViewDataColumn task = new GridViewDataColumn(); 
                task.Name = "FailedFaxTaskName"
                task.Header = "Task"
                task.IsFilterable = false
                task.IsGroupable = false
                task.IsReadOnly = true
                task.DataMemberBinding = new Binding("DataRow[sgItemName]"); 
                task.Width = GridViewLength.Auto; 
                ffDefs.FieldDescriptors.Add(task); 
 
                GridViewDataColumn TaskNotes = new GridViewDataColumn(); 
                TaskNotes.Name = "TaskNotes"
                TaskNotes.Header = "Task Notes"
                TaskNotes.IsFilterable = false
                TaskNotes.IsGroupable = false
                TaskNotes.IsReadOnly = true
                TaskNotes.DataMemberBinding = new Binding("DataRow[mNotes]"); 
                TaskNotes.Width = new GridViewLength(1, GridViewLengthUnitType.Star); 
                TaskNotes.TextWrapping = TextWrapping.Wrap; 
                ffDefs.FieldDescriptors.Add(TaskNotes); 
 
                GridViewDataColumn ReceiptDetails = new GridViewDataColumn(); 
                ReceiptDetails.Name = "ReceiptDetails"
                ReceiptDetails.Header = "Failure Reason"
                ReceiptDetails.IsFilterable = false
                ReceiptDetails.IsGroupable = false
                ReceiptDetails.IsReadOnly = true
                ReceiptDetails.DataMemberBinding = new Binding("sgReciptDetails"); 
                ReceiptDetails.Width = new GridViewLength(1, GridViewLengthUnitType.Star); 
                ReceiptDetails.TextWrapping = TextWrapping.Wrap; 
                ffDefs.FieldDescriptors.Add(ReceiptDetails); 
                e.ChildTableDefinitions.Add(ffDefs); 
            } 
        } 

A warning pops up telling me that this method is obsolete, and doing it this way no longer works.
James
Top achievements
Rank 1
 answered on 11 Nov 2009
1 answer
112 views
I am trying to change the chart type used in the Grouping and Aggregation demo from a Bar to a Line and recieve the following error. 'SelfDrawingSeries' TargetType does not match type of element 'Line' when I try to run it.

The only change I have made to the example code is on this line:
mapping1.SeriesDefinition = new BarSeriesDefinition(); 
 
Changed to 
 
mapping1.SeriesDefinition = new LineSeriesDefinition(); 

This also happens with the SplineSeries as well.

Am I missing something or is this a bug?

Thanks

Edit: I should have mentioned I am using the 10/23 Beta 2 build
David
Top achievements
Rank 1
 answered on 11 Nov 2009
1 answer
96 views
I have two grid's where I can dragdrop from "grid 1" to "grid2", I can drop and insert anywere in the grid (all works fine) but I can only drop in the rows I see.

I need the grid to scroll down if I try to drop at the bottom of the rows, and scroll up if I drop at the top row.

How do I code that in C# (I'm using "RadDragAndDropManager")

Kennet
Top achievements
Rank 2
 answered on 10 Nov 2009
1 answer
85 views
hello,

i am using your grid and i need to set the style of the cells dynamically based on the dataitem i have.
How should i do it?

I thought about inherit from GridViewDataColumn, but didn't know how to do it correctly (i.e. apply the data binding etc)


Thanks,
ofer
Vlad
Telerik team
 answered on 10 Nov 2009
4 answers
172 views
Hi,

It seems I can never get ScrollIntoView work. I got an error when I do:

if (grid.SelectedItem !=null)
    grid.ScrollIntoView(grid.SelectedItem);

Did I miss anything?

Thanks,
Milan
Telerik team
 answered on 10 Nov 2009
1 answer
169 views
i heard that you can do it with ChildTableDefinition

can someone show me how to do it?

i currently have 2 levels (parent->child)
i want to have 3 levels (parent->child->child of child)

how can i do it?

this is the xaml:

<Window x:Class="SimaClient.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    Title="Sima Client" Height="300" Width="400" WindowStyle="ToolWindow">  
    <Grid> 
        <telerik:RadGridView Name="RadGridView1" ShowGroupPanel="False" IsReadOnly="True" AutoGenerateColumns="False" ColumnsWidthMode="Fill">  
 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition /> 
            </telerik:RadGridView.ChildTableDefinitions> 
 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="ID" Width="100" /> 
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name"  Width="200"/>  
            </telerik:RadGridView.Columns> 
 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <telerik:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" ItemsSource="{Binding Routes}" ShowGroupPanel="False" IsReadOnly="True">  
                        <telerik:RadGridView.Columns> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="Route ID" /> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Route Name" /> 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding WayPointsNum , Mode=OneWay }" Header="Number of WP" /> 
                        </telerik:RadGridView.Columns> 
                    </telerik:RadGridView> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 
Vlad
Telerik team
 answered on 10 Nov 2009
1 answer
95 views

i tried using the GridViewColumn.CellTemplate but i can't change it at runtime,

what i want to do is on the RowLoaded event change the cell visual tree(ComboBox, CheckBox)
based on the type of the object in the Cell.Content

i want to be able to change it for each individual cell
not a whole row/Column


i know that somewhere inside the cell there is a:

{System.Windows.Controls.Border}
and inside of it there is

{Telerik.Windows.Controls.GridView.AlignmentContentPresenter}
and inside of it there is the CellTemplate
but i can't access it from c#

 

i also tried to put in the resources of the GridView, couple of DataTemplates for different types (int,brush,enum)
but it ignors the resources

Vlad
Telerik team
 answered on 10 Nov 2009
2 answers
100 views
I setup a simple TileView test application (WPF 2009 Q3 Release).  The tile item does not follow the mouse drag point, especially if mouse acceleration is enabled and the mouse is moved faster.  It happens with multiple rows/columsn but seems most pronounced with a single column such as the code below:    (screenshot attached)  (grabbed first tile item header, moved mouse to bottom, then to top, ended up with blank area at top, mouse pointer at top, tile item 1/2 way up the list.)

Any ideas for fixing this?

 

<Window x:Class="TileViewTest2.Window2" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window2" Height="800" Width="200 " xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">  
    <Grid> 
            <telerik:RadTileView MaxColumns="1" Height="auto" Name="radTileView1" Width="auto" MaximizeMode="Zero">  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem1" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem2" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem3" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem4" Width="auto"/>  
                <telerik:RadTileViewItem Height="auto" Name="radTileViewItem5" Width="auto"/>  
            </telerik:RadTileView> 
    </Grid> 
</Window> 
Tihomir Petkov
Telerik team
 answered on 09 Nov 2009
3 answers
130 views
Hello,

In testing your q3 beta of RadControls for WPF, I believe I have run into a bug with the new TileView control when using it in a WinForm. The TileView control displays properly, however the ability to drag and drop the individual tiles does not work.  This functionality is present when the WPF UserControl containing the TileView is hosted in a WPF Application, however I cannot get it to work when hosting in a WinForm.

Is there something special that I need to do to get the Tileview to function properly in a Windows Form?

Thanks,

Ben
Tihomir Petkov
Telerik team
 answered on 09 Nov 2009
2 answers
147 views
It would be nice to have a comparison between a telerik control and the Microsoft native equivalent if it exists.

It's easier to point management to a web page that illustrates why the telerik control is a better alternative to the built-in control. It would help sell a lot more copies :-)

Thanks,
Ash
Ash
Top achievements
Rank 1
 answered on 09 Nov 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?