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
340
Selecting Grouped Row
posted

Hi,

I have a XamDataGrid with grouping enabled. When I group by some column I get my rows nicely grouped. Now the user should be able to select one of the grouped rows and perform an action in all the items that are grouped under that row. I cant find the way to be able to select a grouped row, can someone help me with this?

Thanks,

Fede

Parents
  • 69686
    Verified Answer
    posted

    Hello Fede,

    The GroupByRecord is activated, however there is no visual indication for that. You can use the following code to select the child records of a GroupByRecord when it is cliecked on (activated)

     private void xamDataGrid1_RecordActivating(object sender, Infragistics.Windows.DataPresenter.Events.RecordActivatingEventArgs e)

            {

                if (e.Record is GroupByRecord)

                {

                    e.Cancel = true;

                    GroupByRecord gr = e.Record as GroupByRecord;

                    gr.IsExpanded = true;

                    xamDataGrid1.SelectedItems.Records.Clear();

                    xamDataGrid1.SelectedItems.Records.AddRange(gr.ChildRecords.ToArray<Record>());

                }

            }

Reply Children
No Data