title: difficulties with AdvancedDatagridView
body: <p>i have already a good Programm which shows my database in a Datagridview,</p>
  
  <p>everything is Ok with it, now i would like to add Filter Option to my Datagridview like Excel Filter</p>
  
  <p>i used : <a href="https://github.com/davidegironi/advanceddatagridview" rel="nofollow noreferrer">AdvanceDatagridview</a> it's an advanced Datagridview with a lot of filter Option,</p>
  
  <p>the problem here, i can not use this datagridview unless i bind it with a Datatable and i also when i did that t found a big problem because in my old code there is Datagridviewrow </p>
  
  <p>and now so i tried to convert Datagridviewrow to datarow to import it in datatable and to use it but it did not work </p>
  
  <p>my Old Code : </p>
  
  <pre><code> sSQL = "SELECT " &amp;
                                          "ItemID, " &amp;
                                          "PSC_tdItems.OrderID, " &amp;
                                          "ArtikelID, " &amp;
                                          "Menge, " &amp;
                                          "Art, "
                                          "CodeID, " &amp;
  
   MyCommand = New SqlCommand(sSQL, conFF)
  
        drW2P = MyCommand.ExecuteReader
        If drW2P.HasRows Then
          While drW2P.Read()
            nField_ItemID = 0
            nField_OrderID = 0              
            nField_Quantity = 0.0
            sField_Art = ""
            sField_pscArticleID = ""
            sField_CodeID = ""
  
  
  If Not DBNull.Value.Equals(drW2P("ItemID")) Then
              nField_ItemID = Convert.ToInt32(drW2P("ItemID"))
            End If
  If Not DBNull.Value.Equals(drW2P("OrderID")) Then
              nField_OrderID = Convert.ToInt32(drW2P("OrderID"))
            End If
  If Not DBNull.Value.Equals(drW2P("Menge")) Then
              nField_Quantity = Convert.ToDouble(drW2P("Menge").ToString.Replace(".", ""))
            End If
  If Not DBNull.Value.Equals(drW2P("Art")) Then
              sField_Art = drW2P("Art").ToString
            End If
  If Not DBNull.Value.Equals(drW2P("ArticelNumber")) Then
          sField_mspArticleNumber = drW2P("ArticelNumber").ToString
        End If
  If Not DBNull.Value.Equals(drW2P("CodeID")) Then
          sField_CodeID = drW2P("CodeID").ToString
        End If 
  Try
              MyRow = New DataGridViewRow
              MyRow.CreateCells(dgvW2P)
              MyRow.SetValues("0",
                                                      imgNotOK.ToBitmap,
                                                      nField_ItemID,
                                                      nField_OrderID,
                                                      nField_Quantity
                                                      sField_Art,
                                                      sField_pscArticleID
                                                      sField_CodeID)
   dgvW2P.Rows.Add(MyRow)
            Catch ex As Exception
              ErrorLogging(True, "Sub FillW2PGrid: Add a line in the grid" &amp; vbCrLf &amp; ex.Message &amp; vbCrLf &amp; "SQL:" &amp; sSQL &amp; vbCrLf &amp; ex.StackTrace.ToString, nErrorLevel_Error)
            Finally
              If Not MyRow Is Nothing Then
                MyRow.Dispose()
                MyRow = Nothing
              End If
            End Try
       End While
        End If
  </code></pre>
  
  <p><strong>my new Code :</strong> </p>
  
  <pre><code>   sSQL = "SELECT " &amp;
                                          "ItemID, " &amp;
                                          "PSC_tdItems.OrderID, " &amp;
                                          "ArtikelID, " &amp;
                                          "Menge, " &amp;
                                          "Art, "
                                          "CodeID, " &amp;
  
   ' here are my new modification
  
  
  Dim Dt As New DataTable
    Dt.Clear()
    Dim cmd As New SqlCommand
  
    If conFF.State = ConnectionState.Open Then
      conFF.Close()
    End If
  
    conFF.Open()
    cmd.Connection = conMspFF
    cmd.CommandType = CommandType.Text
    cmd.CommandText = (sSQL)
  
    Dim da As New SqlDataAdapter(cmd)
    da.Fill(Dt)
  
    bindingSource_data.DataSource = Dt
    dgvW2PNEW.DataSource = bindingSource_data
    dgvW2PNEW.Refresh()
  
        drW2PNEW = MyCommand.ExecuteReader
  </code></pre>
  
  <p>' the problem is here : i can not use HasRow with my new Datagridview</p>
  
  <pre><code> If drW2PNEW.HasRows Then
              While drW2PNEW.Read()
                nField_ItemID = 0
                nField_OrderID = 0              
                nField_Quantity = 0.0
                sField_Art = ""
                sField_pscArticleID = ""
                sField_CodeID = ""
  
  
      If Not DBNull.Value.Equals(drW2PNEW("ItemID")) Then
                  nField_ItemID = Convert.ToInt32(drW2PNEW("ItemID"))
                End If
      If Not DBNull.Value.Equals(drW2PNEW("OrderID")) Then
                  nField_OrderID = Convert.ToInt32(drW2PNEW("OrderID"))
                End If
      If Not DBNull.Value.Equals(drW2PNEW("Menge")) Then
                  nField_Quantity = Convert.ToDouble(drW2PNEW("Menge").ToString.Replace(".", ""))
                End If
      If Not DBNull.Value.Equals(drW2PNEW("Art")) Then
                  sField_Art = drW2PNEW("Art").ToString
                End If
      If Not DBNull.Value.Equals(drW2PNEW("ArticelNumber")) Then
              sField_mspArticleNumber = drW2PNEW("ArticelNumber").ToString
            End If
      If Not DBNull.Value.Equals(drW2PNEW("CodeID")) Then
              sField_CodeID = drW2PNEW("CodeID").ToString
            End If 
      Try
                  MyRow = New DataGridViewRow
                  MyRow.CreateCells(dgvW2PNEW)
                  MyRow.SetValues("0",
                                                          imgNotOK.ToBitmap,
                                                          nField_ItemID,
                                                          nField_OrderID,
                                                          nField_Quantity
                                                          sField_Art,
                                                          sField_pscArticleID
                                                          sField_CodeID)
  ' here i get the error
   dgvW2PNEW.Rows.Add(MyRow)
                Catch ex As Exception
                  ErrorLogging(True, "Sub FillW2PGrid: Add a line in the grid" &amp; vbCrLf &amp; ex.Message &amp; vbCrLf &amp; "SQL:" &amp; sSQL &amp; vbCrLf &amp; ex.StackTrace.ToString, nErrorLevel_Error)
                Finally
                  If Not MyRow Is Nothing Then
                    MyRow.Dispose()
                    MyRow = Nothing
                  End If
                End Try
           End While
            End If
  </code></pre>
  
  <p>Thank you in Advance</p>