Adding Columns at runtime in datagrid control

Discussion in 'ASP .Net Datagrid Control' started by Naveed Alam, Sep 5, 2003.

  1. Naveed Alam

    Naveed Alam Guest

    have a datgrid control that has 3 columns defined at design time.
    Remaining columns are coming from a query and not known until runtime. I
    have dynamically added the columns in datagrid and constructed an array
    that holds results to be displayed in the corresponding cells of newly
    added columns. I don't know how to assign these array members to
    corresponding cells of these columns.
    I am using datarow's itemarray property to assign the array members to
    each corresponding cell. but getting an error stating "Input array is
    longer than the number of columns in this table". Please tell me the
    exact way of doing my task. Any help please???




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Naveed Alam, Sep 5, 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. Chip
    Replies:
    1
    Views:
    390
  2. =?Utf-8?B?RGF2ZXkgUA==?=

    Datagrid Template Columns At Runtime

    =?Utf-8?B?RGF2ZXkgUA==?=, Jun 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    463
    =?Utf-8?B?RGF2ZXkgUA==?=
    Jun 10, 2005
  3. Alan Seunarayan
    Replies:
    5
    Views:
    573
    =?Utf-8?B?Sm9obiBUZWFndWU=?=
    Jul 27, 2005
  4. rob thomson
    Replies:
    0
    Views:
    267
    rob thomson
    Sep 4, 2003
  5. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
Loading...

Share This Page