how to set control properties at run time?

Discussion in 'ASP .Net' started by Tim Mackey, Dec 2, 2003.

  1. Tim Mackey

    Tim Mackey Guest

    hi,
    i have a DictionaryEntry[] of key/value property values, and i want to
    apply them all to a control (datagrid) at run time. i tried using
    attributes, but the docs say that these are for non-property items,
    the following code outputs the formatting attributes as text directly
    after the control is rendered on the page.

    foreach(DictionaryEntry de in array)
    this.DataGrid1.Attributes[de.Key.ToString()] = de.Value.ToString();

    the reason i'm doing this at run time is because i'm creating a
    datagrid on the fly with formatting options for it stored in a db.

    any ideas?
    many thanks
    tim mackey.

    -------------------------
    67d0ebfec70e8db3
     
    Tim Mackey, Dec 2, 2003
    #1
    1. Advertisements

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. Paul Cook
    Replies:
    0
    Views:
    588
    Paul Cook
    Nov 6, 2003
  2. Replies:
    0
    Views:
    641
  3. flamesrock
    Replies:
    8
    Views:
    818
    Hendrik van Rooyen
    Nov 24, 2006
  4. Pierre Yves
    Replies:
    2
    Views:
    761
    Pierre Yves
    Jan 10, 2008
  5. kalyan chakravarthy

    how to assign custom server control properties at run time?

    kalyan chakravarthy, Oct 1, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    219
    kalyan chakravarthy
    Oct 1, 2003
  6. Zarko Gajic

    Child control renders at desing-time as if it is in run-time...

    Zarko Gajic, Mar 14, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    253
    Zarko Gajic
    Mar 16, 2005
  7. Angel Ko

    How do I set up a control's visible property at run time

    Angel Ko, Oct 13, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    196
  8. James Wong
    Replies:
    4
    Views:
    776
    James Wong
    Jul 14, 2004
Loading...