Posted 7 September 2019, 9:57 am EST
Hello,
I’m using the code below to search all columns in a C1TrueDBGrid (C1AOP5)control for text entered in a text box in my Windows App. How do I modify the code below to achieve the same for a FlexGrid in my ASP.NET MVC App?
If possible, can you please send me sample application with the solution.
Code below is activated from the Form Load Event: A datatable “FilteredDTA” is should already available in the ASP.NET App.
fsLinkAOP5 = New System.IO.FileStream(Application.StartupPath + “\AOPs.xml”, IO.FileMode.Open)
dtsetLinkAOP5X.Clear()
dtsetLinkAOP5X.ReadXml(fsLinkAOP5)
fsLinkAOP5.Close()
Dim FilteredDTA As DataTable
FilteredDTA = dtsetLinkAOP5X.Tables(0)
Dim view5 As DataView
Dim query5 As String = “”
query5 = FilteredDTA.Columns(0).ColumnName & “= '” & FormGlobalMain.TextBox1.Text & “'”
For x = 1 To FilteredDTA.Columns.Count - 1
query5 &= " OR " & FilteredDTA.Columns(x).ColumnName & “= '” & FormGlobalMain.TextBox1.Text & “'”
Next
view5 = New DataView(FilteredDTA)
view5.RowFilter = query5
If view5.Count <> 0 Then
C1AOP5.DataSource = view5
C1AOP5.Visible = True
C1AOP5.Splits(0).DisplayColumns(0).Visible = False
apply = True
C1AOP5.Refresh()
For Each cdc As C1DisplayColumn In C1AOP5.Splits(0).DisplayColumns
cdc.FetchStyle = True
Next
For i As Integer = 0 To C1AOP5.Columns.Count - 1 Dim count As Integer = 0 For j As Integer = 0 To C1AOP5.Splits(0).Rows.Count - 1 If C1AOP5(j, i).ToString() = "N/A" Or C1AOP (j,i).ToString () = "" Then count = count + 1 End If If count = C1AOP5.Splits(0).Rows.Count Then C1AOP5.Splits(0).DisplayColumns(i).Visible = False End If Next Next Else C1AOP5.Visible = False End If
Thanks,
Victor