using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls;

namespace ExpressionColumnCellTemplateSelector
{
    public class MyCellTemplateSelector : DataTemplateSelector
    {
        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            var cell = container as GridViewCell;
            
            var expressionColumn = cell.Column as GridViewExpressionColumn;
            if (expressionColumn != null)
            {
                var content = expressionColumn.GetCellContent(item);
                if ((double)content > 2)
                {
                    return bigStadium;
                }
                else
                {
                    return smallStadium;
                }
            }
            return null;
        }

        public DataTemplate bigStadium { get; set; }

        public DataTemplate smallStadium { get; set; }
    }
}