using System.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Data;

namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();

            DataContext = new MyDataContext();
        }

        void RadGridView1_DistinctValuesLoading(object sender, GridViewDistinctValuesLoadingEventArgs e)
        {
            var client = ((MyDataContext)DataContext).Client;
            var collection = new RadObservableCollection<object>();

            e.ItemsSource = collection;

            client.GetDistinctValuesCompleted += (s, args) => 
            { 
                collection.Clear(); 
                collection.AddRange(args.Result); 
            };

            client.GetDistinctValuesAsync(e.Column.UniqueName);
        }
    }
}