Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys.

i have a datagridview containing columns and rows from a xml file.

columns : symbol-account-asset-source

how can i filter my datagridview according to (Exp) symbol column ?

i mean create a textbox and filter datagridview if textbox.text equals symbol value

of rows ?
Posted

1 solution

Here. Try This

VB
For I = 0 To dgv.RowCount - 1
      If dgv.Rows(I).Cells(1).Value.ToString = "Your Search Text" Then
          TextBox1.Text = dgv.Rows(I).Cells(0).Value.ToString
      End If
Next


In IF Condition, Change the value of cell to column Index from where you have to search your text value and then assign the correct cell value from that row to text box.

Hope this helps.
 
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