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
225
Problems with UltraDatasource
posted

Hi,

I have a problem using an UltraDataSource instance with different data schemas at runtime. I do not know a designtime how many columns and their names i have to show on the first level of my datagrid. For that i inspect the first row of my datasource and create the schema dynamically at runtime.

this.invalidDataSource.Reset();

this.invalidDataSource.Band.Key = customer.Name;

foreach (XmlNode node in customer.ChildNodes)

{

if (node.Name != CsvReader.ErrorsTag)

{

this.invalidDataSource.Band.Columns.Add(node.Name, typeof(string));

}

}

UltraDataBand childBand = this.invalidDataSource.Band.ChildBands.Add(CsvReader.ErrorsTag);

childBand.Columns.Add(CsvReader.ErrorTag, typeof(string));

The invalidDatasource is the Datasource of an UltraWinGrid.

When i load the data the first time, all works as expected. I get 2 bands in the grid. One with the key customer.Name and one with the key CsvReader.ErrorsTag.

But when I invoke this code a second time, i suddenly get 3 bands in the grid. one with the key customer.Name and twice with the key CsvReader.ErrorsTag. One of this bands contains the expected column CsvReader.Error and the second contains all columns of the customer.Name band.

The UltraDataSource contains only the two correct bands.

What I am doing wrong. Can anybody help me, or is this a bug. We are using version 6.3

 

Thanks very much

Andreas

Parents Reply Children
No Data