Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Drag Selection does not work on XamGrid with GroupColumns
posted

When using GroupColumns in XamGrid I am unable to select multiple cells using mouse drag.  I believe I have set the correct properties since the moment I remove the group columns the drag selection works immediately.  

The following code reproduces this:

Xaml:

   <ig:XamGrid AutoGenerateColumns="False" ItemsSource="{Binding DataSource}">
        <ig:XamGrid.SelectionSettings>
            <ig:SelectionSettings CellClickAction="SelectCell" CellSelection="Multiple"/>
        </ig:XamGrid.SelectionSettings>
        <ig:XamGrid.Columns>
            <ig:TextColumn Key="C"/>
            <ig:GroupColumn Key="AB" >
                <ig:GroupColumn.Columns>
                    <ig:TextColumn Key="A"/>
                    <ig:TextColumn Key="B"/>
                </ig:GroupColumn.Columns>
            </ig:GroupColumn>
        </ig:XamGrid.Columns>
    </ig:XamGrid>
Code Behind:
    public partial class MainWindow
    {
        public IEnumerable<Field> DataSource { get; set; }
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;
            DataSource =
                new[]
                    {
                        new Field {A = 1, B = 2, C = 3},
                        new Field {A = 2, B = 3, C = 4},
                        new Field {A = 3, B = 4, C = 5},
                    };
        }
    }
    public class Field
    {
        public int A { get; set; }
        public int B { get; set; }
        public int C { get; set; }
    }


In the example you will find that it is possible to drag select the non grouped column but not grouped columns.  Removing the columns from the GroupColumn will make them work however.


Does anyone have any ideas on how to drag select with GroupColumns on XamGrid?

Note: I am using the WPF version - not sure if there is a difference but I couldn't find XamGrid category in the WPF forum.

Thanks