简体   繁体   中英

How to hide a specific row of devexpress GridControl?

in c# datagrid use this code:

dataGridView.Rows[rowIndex].Visible = false;

What is the equivalent in devexpress gridControl ?

The equivalent is ColumnView.CustomRowFilter event. You can use this event to hide particular rows. Use RowFilterEventArgs.ListSourceRow property to get the index of record in GridControl.DataSource and set RowFilterEventArgs.Visible property to false and the RowFilterEventArgs.Handled property to true to hide the row.
Here is example for hide row by rowIndex variable:

private void gridView1_CustomRowFilter(object sender, RowFilterEventArgs e)
{    
    if (e.ListSourceRow == rowIndex)
    {
        e.Visible = true;
        e.Handled = true;
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM