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
70
Maximum visible rows limitation
posted

I use UltraDataSource as UltraGrid.DataSource (version 7.1).

How to showing first 100 rows in Grid and other rows hide (as does FilterRow)?

Parents
  • 37774
    Verified Answer
    posted

    There are 2 ways you could go about doing this:

    1) Use InitializeRow:

    private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
    {
        if (e.Row.Index >= 100)
            e.Row.Hidden = true;
    }

    2) Use a custom FilterCondition:

    private class First100RowsCondition : FilterCondition
    {
        public override bool MeetsCriteria(UltraGridRow row)
        {
            return row.Index < 100;
        }
    }

    private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {
        e.Layout.Bands[0].ColumnFilters[0].FilterConditions.Add(new First100RowsCondition());
    }

    -Matt

Reply Children
No Data