I use row detail in radgridview but encounter some tricky problem. Please use the code below, and click the + to show the detail row one by one, at least open one screen, then scroll the vertical scrollbar , or use mouse wheel, then if you are lucky, the sceen will tremble, unless you scroll again. To reproduce it maybe need some fortume, but i could reproduce it everytime. I am not sure if I make myself clear. How to solve this problem? Thanks.
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" Title="MainWindow" d:DesignHeight="1024" d:DesignWidth="1280" MinHeight="700" MaxHeight="1024" MaxWidth="1280" SnapsToDevicePixels="True"> <Grid> <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False" IsReadOnly="True"> <telerik:RadGridView.Columns> <telerik:GridViewToggleRowDetailsColumn/> <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="" Width="600"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding UserID}" TextAlignment="Center" Header="CUSIP" Width="400" /> <telerik:GridViewDataColumn DataMemberBinding="{Binding ClientID}" TextAlignment="Center" Header="PRCMnum" Width="400" /> </telerik:RadGridView.Columns> <telerik:RadGridView.RowDetailsTemplate> <DataTemplate> <Grid x:Name="rowDetails"> <StackPanel Orientation="Horizontal" Margin="200,5,0,5"> <Label Content="ID:" Margin="0,0,5,0"/> <TextBox Text="{Binding ID}" Width="80" /> <Label Content="UserID:" Margin="10,0,5,0"/> <TextBox Text="{Binding UserID}" Width="80" /> <Label Content="ClientID:" Margin="10,0,5,0"/> <TextBox Text="{Binding ClientID}" Width="80" /> </StackPanel> </Grid> </DataTemplate> </telerik:RadGridView.RowDetailsTemplate> </telerik:RadGridView> </Grid> </Window>
using System; using System.Collections.Generic; using System.Windows; using System.Windows.Documents; using System.Collections.ObjectModel; namespace WpfApplication1 { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); this.radGridView.ItemsSource = new ObservableCollection<AgencySpecPool>(GetSpecPoolInfoHierarchy()); } List<AgencySpecPool> GetSpecPoolInfoHierarchy() { List<AgencySpecPool> list = new List<AgencySpecPool>(); for (int i = 0; i < 1000; i++) { int seed = (int)DateTime.Now.Ticks + i; Random rand = new Random(seed); list.Add(new AgencySpecPool(rand.Next(), rand.Next(), rand.Next())); } return list; } } public class AgencySpecPool { public int ID {get;set;} public int UserID { get; set; } public int ClientID { get; set; } public AgencySpecPool(int id, int uid, int cid) { ID = id; UserID = uid; ClientID = cid; } } }