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.
public class Visualitems : List<Visualitem> { |
object Parent { get; set; } |
} |
public abstract class Visualitem { |
public object Parent { get; set; } |
} |
public class GridDataItem : Visualitem { |
public GridDataItem( string first, string middle, string last ) { |
this.FirstName = first; |
this.LastName = last; |
this.MiddleName = middle; |
} |
public string FirstName { get; set; } |
public string MiddleName { get; set; } |
public string LastName { get; set; } |
} |
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 ); |
<Controls1:RadGridView ItemsSource="{Binding Orders}" AutoGenerateColumns="True"></Controls1:RadGridVie> |
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
<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> |