Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
Error 'Not enough context to add a new row' when AddNew row
posted

Hello,

I'm working with Infragistics.Win.UltraWinGrid.UltraGrid (Infragistics2.Win.UltraWinGrid.v11.1 version 11.1.20111.2050).

How can i add row to grid manually??
When I run the statement uwgFicherosAdjuntos.Rows.Band.AddNew(), show me this error:
'Not enough context to add a new row. Either a row in this band or the parent band has to be active to provide for enough context.'


  Private Sub CargarFicherosAdjuntos()
    'Dim row As Infragistics.Win.UltraWinGrid.UltraGridRow
    Dim i As Integer = 0
    'uwgFicherosAdjuntos.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.Yes 'Infragistics.Win.UltraWinGrid.AllowAddNew.FixedAddRowOnTop

    For Each e As ZipEntry In files_zip
      uwgFicherosAdjuntos.Rows.Band.AddNew()
      'uwgFicherosAdjuntos.DisplayLayout.Bands(0).AddNew()
      uwgFicherosAdjuntos.Rows(i).Cells(0).Value = e.Name 'nombre del fichero
      uwgFicherosAdjuntos.Rows(i).Cells(1).Value = Math.Round(e.Size / 1024, 2) 'tamaño del fichero
      i += 1
    Next

  End Sub
 
Please, can you help me?
Thanks in advance

Parents
No Data
Reply
  • 469350
    Offline posted

    My first guess would be that you are trying to add a row to a grid that has no DataSource. Have you set a DataSource on the grid? If so, then it would make more sense to add the rows to the DataSource before you bind it to the grid rather than adding rows through the UI.

Children
No Data