using System.Collections.Generic;
using InABox.Core;
using Syncfusion.UI.Xaml.Grid;

namespace InABox.DynamicGrid;

public class DynamicGridEnumLookupColumn : DynamicGridComboBoxColumn< EnumLookupEditor>
{
    protected override void Configure(GridComboBoxColumn column, EnumLookupEditor editor)
    {
        var lookups = editor.Values(Definition.ColumnName, null).ToDataTable();
        column.SelectedValuePath = lookups.Columns[0].ColumnName;
        column.DisplayMemberPath = "Display";
        column.ItemsSource = lookups.DefaultView;
    }

    public DynamicGridEnumLookupColumn(DynamicGridColumn definition) : base(definition)
    {
    }
}