Click here to Skip to main content
15,907,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i highlighted cell value (key word) in gridview as change text in textbox(Searchbox) in win form using C#
with filter by propriety of matching key words ..

please help ...as soon as.
thanks
Posted
Comments
ZurdoDev 5-Apr-14 8:02am    
This is not clear.
mukesh mourya 5-Apr-14 8:23am    
ok, i explane you ...
in my win form , have a text box and a grideview(which are bind from db )
I wont, when i change text box value (for searching in gridviwe those value) then highlighted text (or words in yellow color) in grid view
sahabiswarup 6-Apr-14 2:43am    
in windows form you are using gridview? Use dataGridview instead of Gridview, and add this event CellContentClick to modify color of cell for your required condition.

1 solution

Hello
You have to check each of cell text value in your TextChanged event and Code something like below

C#
private void textBox1_TextChanged(object sender, EventArgs e)
       {
           foreach (DataGridViewRow row in dataGridView.Rows)
           {
               if (row.Cells[0].Value.ToString() == "someVal")
               {
                   row.DefaultCellStyle.BackColor = Color.Yellow;
               }
           }
       }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900