How to add column to databand programatically
Posted: Sat Mar 01, 2014 5:45 pm
Say I have this:
But then I want to do something like this:
But it says that 'Stimulsoft.Report.Dictionary.StiDataColumn' cannot be converted into 'Stimulsoft.Report.Components.StiComponent'.
Then I tried to convert the column to a component but it didn't work:
It said the expression wasn't a method.
So how can a column be added to a databand via code?
Code: Select all
Dim myDataband As New StiDataBand()
Code: Select all
Dim myColumn As New StiDataColumn
myDataband.Components.Add(myColumn)
Then I tried to convert the column to a component but it didn't work:
Code: Select all
TryCast(Report.GetComponentByName(myColumn.Name), StiComponent)
So how can a column be added to a databand via code?