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. 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. Replies:
    0
    Views:
    575
  2. Pierre Yves
    Replies:
    2
    Views:
    511
    Pierre Yves
    Jan 10, 2008
  3. 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:
    149
    kalyan chakravarthy
    Oct 1, 2003
  4. Peter

    properties not showing in properties window at design time

    Peter, Dec 10, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    229
    Lostinet.Web Support
    Dec 10, 2003
  5. James Wong
    Replies:
    4
    Views:
    525
    James Wong
    Jul 14, 2004
Loading...

Share This Page