Y
Y
youngpr2020-10-15 14:15:56
C++ / C#
youngpr, 2020-10-15 14:15:56

How to implement search in DataGrid?

How to implement search in DataGridTextColumn?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cicatrix, 2020-10-15
@youngpr

If the DataGrid has a data source, then it is better to search by this source. If there is no data source, then
loop through each cell, where to look, check if the desired combination occurs in the text of each cell.
If you need a case-insensitive search (no matter if it is written in capital or small letters), then either convert the text of each cell to upper / lower case when comparing (the same with the search text), or with a regular expression.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question