Telerik Forums
UI for WPF Forum
4 answers
156 views

Hello,

I have recently upgraded to the latest Q3 release and have run into a problem that used to work with the Q2 binaries.  I have an object that I use to “collect” properties from multiple objects for displaying on a grid.  For instance, I have a person object with name properties, and an address object(collection) with its fields.  In a grid, I’d like to display the person’s name and their (primary) address.

I had a solution that worked well in the Q2 binaries, but since the upgrade my solution will no longer work as the item source seems to look at the base class, instead of the object being passed in. 

Here’s a boiled down example to illustrate my issue.   


Here's the class difinitions:
        public class Visualitems : List<Visualitem> {  
            object Parent { getset; }  
        }  
        public abstract class Visualitem {  
            public object Parent { getset; }  
        }  
        public class GridDataItem : Visualitem {  
            public GridDataItem( string first, string middle, string last ) {  
                this.FirstName = first;  
                this.LastName = last;  
                this.MiddleName = middle;  
            }  
            public string FirstName { getset; }  
            public string MiddleName { getset; }  
            public string LastName { getset; }  
        }  
 

Here's how I attempt to setup and populate the grid:
            Visualitems items = new Visualitems();  
            items.Add( new GridDataItem( "Jon""A""Smith" ) );  
            items.Add( new GridDataItem( "Tom""P""Jones" ) );  
            items.Add( new GridDataItem( "Ken""W""Adams" ) );  
            items.Add( new GridDataItem( "Kelly""C""Truman" ) );  
 
            Telerik.Windows.Controls.GridViewDataColumn gvc = new Telerik.Windows.Controls.GridViewDataColumn();  
            gvc.UniqueName = "FirstName";  
            gvc.Header = "First Name";  
            gvc.DataContext = "FirstName";  
            gvc.IsVisible = true;  
            gvc.Width = new Telerik.Windows.Controls.GridViewLength( 1, Telerik.Windows.Controls.GridViewLengthUnitType.Star );  
            grid.Columns.Add( gvc );  
              
            Binding binding = new Binding();  
            binding.Source = items;  
            binding.Mode = BindingMode.OneWay;  
            binding.BindsDirectlyToSource = true;  
 
            grid.DataContext = binding.Source;  
            grid.SetBinding( Telerik.Windows.Controls.RadGridView.ItemsSourceProperty, binding ); 

This will generate the error:  "Property with name FirstName cannot be found on type Visualitem"

Any guidance on this matter would be appreciated...

Thank you in advance for your time,

Craig
capsule
Top achievements
Rank 1
 answered on 30 Nov 2009
1 answer
74 views
Hi, i am trying to use RadGridView
i have add the reference dll and add namespace definition, 
and use this Code in my project 

<Controls1:RadGridView ItemsSource="{Binding Orders}" AutoGenerateColumns="True"></Controls1:RadGridVie> 


I have no compiler error, but when i lunch the application i get the follow exception:

Can not assign value  '/Telerik.Windows.Controls.GridView;component/themes/office/black/GridViewToggleButton.xaml' to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object. Error at object 'System.Windows.ResourceDictionary' at markup file 'Telerik.Windows.Controls.GridView;;;Component/Themes/GenericOfficeBlack.xaml'.

How Can i solve my problem ? 


Rossen Hristov
Telerik team
 answered on 30 Nov 2009
1 answer
95 views
Hi,
I am creating a chart in code behind.

I have a small problem when using SplineAreaSeriesDefinition -> see attachment.
I cant get the series x axis to start at zero ?

Does anyone have a tip ?

Best regards.
krissi.
Sia
Telerik team
 answered on 30 Nov 2009
1 answer
57 views
All,

   I have found a bug in the RadGridView control which causes the group area to be larger then expected.  To reproduce this bug, just set the MinHeight property of the grid view control to some large number.  This even proves true in designer mode.

- Rashad Rivera
Kalin Milanov
Telerik team
 answered on 30 Nov 2009
1 answer
82 views
Hi,

When I set a filter on the GridviewComboboxColumn I see the SelectedValuePath instead of the DisplaymemberPath.
This is not what you would expect.

In your RadComboBox you have an ItemTemplate and a SelectionBoxItemTemplate.  I also would like to have this behaviour for the GridViewComboBoxColumn. Is this possible?

Thanks,

Thomas.
Rossen Hristov
Telerik team
 answered on 30 Nov 2009
2 answers
88 views
Hi.

At the moment I can only show one property in the gridviewcomboboxcolumn; the property name I assign to the displaymemberpath.

What I like to do, is to show a datatemplate where I use a combination of several properties of the itemssource e.g. Firstname and Lastname. Is this possible?

Thanks,

Thomas
Thomas
Top achievements
Rank 1
 answered on 30 Nov 2009
1 answer
73 views

Hi,

 

we are just migrated to the Silverlight. In that we are used the RadGridView.

So can you please let know any way to implement Pagination of Telerik Radgrid in Silverlight.

 

Thanks In Advance.

 

Regards,

S s

Vlad
Telerik team
 answered on 30 Nov 2009
2 answers
403 views
Hi,

Since the last update (2009.3.1120.35), some of my radcombobox's are not working anymore:
in the selectionbox the linq to sql entity is shown instead of the DisplayMemberPath property.
The selected item is shown as expected.


 <telerik:RadComboBox   
                                          Margin="2,0,0,0"  
                                          Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="4" 
                                          Name="cbOmschrijving" 
                                          ToolTip="Standaard omschrijving artikel" 
                                          DisplayMemberPath="Tekst" 
                                           
                                          SelectedValuePath="NLStandaardTekstID" 
                                          SelectedValue="{Binding StandaardOmschrijvingID 
                                                ,UpdateSourceTrigger=PropertyChanged}" 
                                          Height="20" > 
                                    <telerik:RadComboBox.ContextMenu> 
                                        <ContextMenu> 
                                            <MenuItem Header="Bewerken" Click="OmschrijvingBewerken"/> 
                                        </ContextMenu> 
                                    </telerik:RadComboBox.ContextMenu> 
                                </telerik:RadComboBox> 


Thomas
Top achievements
Rank 1
 answered on 30 Nov 2009
1 answer
50 views
can you show me an example of how to make a gridview which sorts it's columns?

code it only in xaml

thanks
Vlad
Telerik team
 answered on 30 Nov 2009
7 answers
143 views
Hi,


but it doesn't work. it doesn't even compile. Can someone help?
Milan
Telerik team
 answered on 27 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?