Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Extensions
- {
- public static DataGridView SearchDataGrid(this DataGridView Grid, string Text = "")
- {
- foreach (DataGridViewRow linha in Grid.Rows)
- {
- foreach (DataGridViewCell celula in linha.Cells)
- {
- if (string.IsNullOrWhiteSpace(Text) || celula.Value.ToString().Contains(Text))
- {
- linha.Visible = true;
- break;
- }
- linha.Visible = false;
- }
- }
- return Grid;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement