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
350
Getting number of checked rows
posted
I have added an unbound Boolean column to my grid and I want to get the number of rows that are checked. I know that one of the solutions is to iterate throw the rows and I can most defiantly do that. I was wondering if there was a more efficient way of do this.  Any help would be appreciated.

Thank you in advance,

Stephen

Parents
  • 37774
    posted

    Stephen,

    The other way that I can think of for doing this would be to apply a filter to the column and get the count of the number of rows remaining.  You would also likely want to suspend painting of the grid while you do this.

    this.ultraGrid1.BeginUpdate();
    this.ultraGrid1.DisplayLayout.Bands[0].ColumnFilters["Col 1"].FilterConditions.Add(FilterComparisionOperator.Equals, true);
    int count = this.ultraGrid1.Rows.GetFilteredInNonGroupByRows().Length;
    this.ultraGrid1.DisplayLayout.Bands[0].ColumnFilters["Col 1"].ClearFilterConditions();
    this.ultraGrid1.EndUpdate();

    -Matt

Reply Children