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
110
Delete all data, all bands, all rows -- but leave settings intact
posted

I've got a UltraWinGrid bound to a UltraDataSource.  I've used design-time to create the column/band layouts in the UltraDataSource.  The UltraWinGrid is design-time bound to the UltraDataSource.

In code in my LoadData() routine, I load the UltraDataSource row by row, band by band (one root band, one child band("Location")) like this:

      For Each t As RFATariff In Card.TariffList.Values
         Dim dr As UltraDataRow = dsPricing.Rows.Add

         dr("TariffKey") = t.TariffKey

         ... etc ...

         Dim LocationRows As UltraDataRowsCollection = dr.GetChildRows("Location")

         For Each l As RFALocation In t.LocationList.Values
            Dim ldr As UltraDataRow = LocationRows.Add

            ldr("LocationKey") = l.LocationKey
           ...etc...

         Next
      Next

      For Each c As UltraGridColumn In dgrPricing.DisplayLayout.Bands(0).Columns
         c.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, True)
      Next

      For Each c As UltraGridColumn In dgrPricing.DisplayLayout.Bands("Location").Columns
         c.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, True)
      Next

All this works fantastic.

My problem comes when I want to reload the form.

I tried dsPricing.Rows.Clear() but this cleans out the layout of the ultradatasource.... 

I hate it if I'm missing something simple, but how can I just clear out the datarows from the entire data source without resetting properties/settings at the same time?

 

Parents Reply Children