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
530
Define my own UltraDataSource with my columns...
posted

Hey Mike,

 I am creating a derived UltraDataSource that has my own custom columns.  I have been using the ctor to create the columns (the setup proc is called by the ctor):

private void SetUp() {

_colName = this.Band.Columns.Add("CalendarName", typeof(string));

_colAccessLevel = this.Band.Columns.Add("AccessLevel", typeof(string));

_colDateCreated = this.Band.Columns.Add("DateCreated", typeof(DateTime));

_colDateUpdated = this.Band.Columns.Add("DateUpdated", typeof(DateTime));

_colOwner = this.Band.Columns.Add("CalendarOwner", typeof(string));

}

But when I put this on a form and bind it to a grid, I get this designercode:

ultraDataColumn3.DataType = typeof(System.DateTime);

ultraDataColumn4.DataType = typeof(System.DateTime);

this.udsGoogleCals1.Band.Columns.AddRange(new object[ {

ultraDataColumn1,

ultraDataColumn2,

ultraDataColumn3,

ultraDataColumn4,

ultraDataColumn5});

Which throws a key already exists.  So the ctor is not the place to define the columns.

 Where should I do this?  Is there another way to get around not having to comment out this designer code (which I am now going to confession for...).

 

Thanks!

Bob