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
1155
Changing the Display count on Sorted Items
posted

Question: I want to modify the record count display for grouped/sorted items

I have a button which groups and expands a certain item based on the Description - ok easy enough.

Now, I am checking each row displayed to see if it has a certain value in a column, say > 0. If not I collapse the visible row. At the same time I want to reduce by 1 the number of records shown as ChildRecords of the group. Is it possible to modify that count.

Bottom line: If a record doesn't meet a criteria, it doesn't get displayed. Also I don't want the user thinking there are more records in the group than which are actually displayed.

Clear? Below is where I sort out the records. All works well here. Obviously I can't set the readOnly Count property, but in pseudo code that's what I want to accomplish.

Regards,

Glenn Long

  void AreaUnitDetails_RecordsInViewChanged(object sender, Infragistics.Windows.DataPresenter.Events.RecordsInViewChangedEventArgs e)
        {           
            Infragistics.Windows.DataPresenter.Record[] gbr;
            gbr = this.AreaUnitDetails.GetRecordsInView(false);
          

            foreach (Infragistics.Windows.DataPresenter.Record rec in gbr)
            {
                if (!rec.IsExpanded && rec.Description.StartsWith("CT"))
                {
                    rec.IsExpanded = true;

                    var children = rec.ViewableChildRecords.ToList();

                    foreach (Record child in children)
                    {
                        if (((ASEngine.BusinessObjects.Entities.UnitDetail)(((Infragistics.Windows.DataPresenter.DataRecord)(child)).Cells.Record.DataItem)).RegMW.Value == 0)
                            child.Visibility = Visibility.Visible;
                        //rec.ViewableChildRecords.Count = rec.ViewableChildRecords.Count;  // Decrement count Displayed by 1.
                    }                  

                 
                }
            }           

        }  

 

Picture: As you can see the group CT has 4 records by count but none displayed as I have filtered them out. I want that count to show 0 or whatever is left in the list.

 

Parents
  • 69686
    Verified Answer
    posted

    Hello,

    This count is the Description property of the GroupByRecord, so you can modify that. Something like this:

    GroupByRecord gr = xamDataGrid1.Records[0] as GroupByRecord;

                gr.Description = "3 Items";

Reply Children
No Data