如何过滤datagridview [英] how to filter datagridview
问题描述
伙计们.
我有一个datagridview,其中包含来自xml文件的列和行.
列:symbol-account-asset-source
如何根据(Exp)符号列过滤我的datagridview?
我的意思是如果textbox.text等于符号值,则创建一个文本框并过滤datagridview
的行数?
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 ?
推荐答案
此处.试试这个
Here. Try This
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
在"IF条件"中,将单元格的值更改为必须从中搜索文本值的索引列,然后从该行中的文本框中分配正确的单元格值.
希望这会有所帮助.
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.
这篇关于如何过滤datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!