Dynamic Columns

Discussion in 'ASP .Net Datagrid Control' started by Jeremy, Aug 12, 2004.

  1. Jeremy

    Jeremy Guest

    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
    Jeremy, Aug 12, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. helpful sql
    Replies:
    0
    Views:
    786
    helpful sql
    May 19, 2005
  2. Replies:
    5
    Views:
    569
  3. Replies:
    4
    Views:
    918
  4. =?Utf-8?B?YmVub2l0?=

    Read CSV - string Columns - Int columns

    =?Utf-8?B?YmVub2l0?=, May 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    421
    =?Utf-8?B?YmVub2l0?=
    May 8, 2006
  5. Jacksm
    Replies:
    2
    Views:
    828
    Paul Chalekian
    Nov 21, 2006
Loading...

Share This Page