3
Answers

Highlight search text in items in the WPF Listview (Like search text highlight in Google chrome)

kiran k

kiran k

14y
8.4k
1

I am using MVVM to show the database records in a gridview (ListView view). i have a textbox where we can enter the text to be searched in the results listed in the gridview. i tried many ways to highlight the search text (Not the entire row only the text matches in the record) in the records displayed in the list view but unable to highlight. I am using viewmodel as the datacontext for this window. i tried searching on the web and tried using different approaches but unable to highlight the text.

Can anyone have solution for this. Thanks in advance.

Answers (3)
0
Nitesh Luharuka
NA 18k 1.5m 12y
You mentioned there is a textbox for entering Bill number, however you are using
cb_billno.SelectedItem
to get the bill number. I think, you should use txtBillNo.Text where txtBillNo is the textbox ID.