Dynamic Columns

J

Jeremy

If I create the Columns Dynamically in the OnInit Event,


for i := 1 to 15 do
Begin
if Assigned(myAssessment.GetProperty('column'+ i.ToString)) then
Begin
StrandColumn := TemplateColumn.Create;
with StrandColumn do
Begin
CssClass:='MenuCaption';
ItemStyle.VerticalAlign := VerticalAlign.Top;
ItemTemplate := TItemTemplate.Create;
Columns.Add(StrandColumn);
End;
End;
End;



and in the dataitem I have a custom class for each column ie

column1 : TMyColumn;
column2 : TMyColumn;
etc
etc


How do I go about setting the text of the data cell to a property of
TMyColumn.

ie column1.Name;


Cheers
Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top