or
<Window.Resources> <my:GoodsInStoreDataSet x:Key="dsMy" /> <CollectionViewSource x:Key="vs_t_test" Source="{Binding Path=t_test, Source={StaticResource dsMy}}" /></Window.Resources><Grid DataContext="{StaticResource vs_t_test}"> <telerik:RadGridView ItemsSource="{Binding}" Name="rdGrid" AutoGenerateColumns="False" MouseDoubleClick="rdGrid_MouseDoubleClick"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="ID"/> <telerik:GridViewDataColumn DataMemberBinding="{Binding NOTE}" Header="Note"/> <telerik:GridViewImageColumn DataMemberBinding="{Binding Picture}" Header="Pic" MinWidth="100" ImageStretch="Fill" MaxWidth="100"/> </telerik:RadGridView.Columns> </telerik:RadGridView></Grid>private void Window_Loaded(object sender, RoutedEventArgs e){ GoodsInStore.GoodsInStoreDataSet dsGIS = ((GoodsInStore.GoodsInStoreDataSet)(this.FindResource("dsMy"))); GoodsInStore.GoodsInStoreDataSetTableAdapters.t_testTableAdapter ta_t_test = new GoodsInStore.GoodsInStoreDataSetTableAdapters.t_testTableAdapter(); ta_t_test.Fill(dsGIS.t_test); System.Windows.Data.CollectionViewSource vs_t_test = ((System.Windows.Data.CollectionViewSource)(this.FindResource("vs_t_test"))); vs_t_test.View.MoveCurrentToFirst(); }private void SaveButton_Click(object sender, RoutedEventArgs e){ GoodsInStore.GoodsInStoreDataSet dsGIS = ((GoodsInStore.GoodsInStoreDataSet)(this.FindResource("dsMy"))); GoodsInStore.GoodsInStoreDataSetTableAdapters.t_testTableAdapter ta_t_test = new GoodsInStore.GoodsInStoreDataSetTableAdapters.t_testTableAdapter(); ta_t_test.Update(dsGIS.t_test);
}private void OnCellDoubleClick(object sender, RadRoutedEventArgs args){ GridViewCellBase cell = args.OriginalSource as GridViewCellBase; if (cell != null && cell.Column.UniqueName == "Picture") { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.DefaultExt = ".jpg"; dlg.Filter = "Jpeg pictures (.jpg)|*.jpg"; Nullable<bool> result = dlg.ShowDialog(); if (result == true) { string filename = dlg.FileName; BitmapImage myBitmapImage = new BitmapImage(); myBitmapImage.BeginInit(); myBitmapImage.UriSource = new Uri(filename, UriKind.RelativeOrAbsolute); myBitmapImage.EndInit(); rdGrid.CurrentCell.Value = myBitmapImage; } } }<Style TargetType="Grid"> <Setter Property="Background" Value="#00000000" /></Style><Window x:Class="TreeListViewExample.MainWindow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" Title="MainWindow" Height="350" Width="525"> <Grid> <Controls:RadTreeListView ItemsSource="{Binding Items}" AutoGenerateColumns="False"> <Controls:RadTreeListView.ChildTableDefinitions> <Controls:TreeListViewTableDefinition ItemsSource="{Binding Children}"/> </Controls:RadTreeListView.ChildTableDefinitions> <Controls:RadTreeListView.Columns> <Controls:GridViewDataColumn Header="Test" DataMemberBinding="{Binding Text}"/> </Controls:RadTreeListView.Columns> </Controls:RadTreeListView> </Grid></Window><Application x:Class="TreeListViewExample.App" StartupUri="MainWindow.xaml"> <Application.Resources> <Style TargetType="Grid"> <Setter Property="Background" Value="Green"/> </Style> </Application.Resources></Application>public partial class MainWindow : Window{ public MainWindow() { InitializeComponent(); DataContext = this; Items = new ObservableCollection<TestClass>(); var child3 = new TestClass {Text = "child 3"}; var child2 = new TestClass {Text = "child 2", Children = new[] {child3}}; var child = new TestClass {Text = "child", Children = new[] {child2}}; Items.Add(child); } public ObservableCollection<TestClass> Items { get; private set; }}public class TestClass{ public string Text { get; set; } public IEnumerable<TestClass> Children { get; set; }}