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
120
Changing DataSource on UltraGrid isn't being reflected in the grid
posted

I have an UltraGrid that uses a generic list for a DataSource.  I update the list in a separate form and then re-attach the list to the UltraGrid's DataSource.  The DataSource reflects the changes, but the grid isn't showing them.  Here is my code:

List<SubtypeColorCode> subtypeColorCodes;
 
            if (this.subtypeColorCodesUltraGrid.DataSource is List<SubtypeColorCode>)
                subtypeColorCodes =
                   (List<SubtypeColorCode>)this.subtypeColorCodesUltraGrid.DataSource;
            else
                //If the data source hasn't been initialized.
                subtypeColorCodes = new List<SubtypeColorCode>();
 
            SubtypeColorCodeForm.ShowForm(thisnew ImageServerProxy(this.tbImagingUri.Text),
                subtypeColorCodes);
 
            //Assign the updated subtype list back to the data source.
            this.subtypeColorCodesUltraGrid.DataSource = subtypeColorCodes;