This question is locked. New answers and comments are not allowed.
Hi. When the RadGridView initializes, everything seems alright. The columns records are shown properly.
As soon as I click somewhere on a column and switch it again all the content of the previous column hides. As soon as I click on it again, the content appears, again. Here my code + screenshots:
C#:
XAML:
Help would be greatly appreciated
As soon as I click somewhere on a column and switch it again all the content of the previous column hides. As soon as I click on it again, the content appears, again. Here my code + screenshots:
C#:
using System;using System.Collections.ObjectModel;namespace RadGridViewTest2{ public partial class MainPage { public ObservableCollection<MyListEntry> MyListEntries { get; set; } public ObservableCollection<OtherEntry> OtherEntries { get; set; } public ObservableCollection<Record> Records { get; set; } public Record SelectedRecord { get; set; } public MainPage() { InitializeComponent(); MyListEntries = new ObservableCollection<MyListEntry>(); OtherEntries = new ObservableCollection<OtherEntry>(); Records = new ObservableCollection<Record>(); for (int i = 0; i < 15; i++) { MyListEntries.Add(new MyListEntry { Id = Guid.NewGuid(), Name = "MyListEntry" + i }); OtherEntries.Add(new OtherEntry { Id = Guid.NewGuid(), Name = "OtherEntry" + i, Description = "NewDescription" + i }); } var r = new Random(); for (int i = 0; i < 100; i++) { Records.Add(new Record { Name = "Record" + i, MyListEntry = MyListEntries[r.Next(14)], OtherEntry = OtherEntries[r.Next(14)] }); } DataContext = this; } } public class MyListEntry { public Guid Id { get; set; } public string Name { get; set; } } public class OtherEntry { public Guid Id { get; set; } public string Name { get; set; } public string Description { get; set; } } public class Record { public string Name { get; set; } public MyListEntry MyListEntry { get; set; } public OtherEntry OtherEntry { get; set; } }}XAML:
<UserControl x:Class="RadGridViewTest2.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <Grid x:Name="LayoutRoot"> <telerik:RadGridView ItemsSource="{Binding Records}" SelectedItem="{Binding SelectedRecord}" AutoGenerateColumns="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" /> <telerik:GridViewComboBoxColumn ItemsSource="{Binding MyListEntries, Mode=OneTime}" DisplayMemberPath="Name" DataMemberBinding="{Binding MyListEntry, Mode=TwoWay}" Header="MyListEntry"/> <telerik:GridViewComboBoxColumn ItemsSource="{Binding OtherEntries, Mode=OneTime}" DataMemberBinding="{Binding OtherEntry, Mode=TwoWay}" Header="OtherEntry" DisplayMemberPath="Name" /> </telerik:RadGridView.Columns> </telerik:RadGridView> </Grid></UserControl>Help would be greatly appreciated