簡體   English   中英

如何隱藏devexpress GridControl的特定行?

[英]How to hide a specific row of devexpress GridControl?

在C#DataGrid中使用以下代碼:

dataGridView.Rows[rowIndex].Visible = false;

devexpress gridControl中的等效項是什么?

等效的是ColumnView.CustomRowFilter事件。 您可以使用此事件隱藏特定的行。 使用RowFilterEventArgs.ListSourceRow屬性獲取GridControl.DataSource中記錄的索引,並將RowFilterEventArgs.Visible屬性設置為false ,將RowFilterEventArgs.Handled屬性設置為true以隱藏行。
這是隱藏rowIndex變量的示例:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM