This example implements a RowVisibilityHelper
helper class. Its HideRow
and ShowRow
methods allow you to hide/show the specified data row:
public class RowVisibilityHelper : Component {
// ...
public void HideRow(int dataSourceRowIndex) {
if (!IsRowInvisible(dataSourceRowIndex))
InvisibleRows.Add(dataSourceRowIndex);
GridView.RefreshData();
}
public void ShowRow(int dataSourceRowIndex) {
if (IsRowInvisible(dataSourceRowIndex))
InvisibleRows.Remove(dataSourceRowIndex);
GridView.RefreshData();
}
public void ToggleRowVisibility(int dataSourceRowIndex) {
if (IsRowInvisible(dataSourceRowIndex))
ShowRow(dataSourceRowIndex);
else
HideRow(dataSourceRowIndex);
}
}
- Form1.cs (VB: Form1.vb)
- RowVisibilityHelper.cs (VB: RowVisibilityHelper.vb)
(you will be redirected to DevExpress.com to submit your response)