How to show array values as columns in a datagrid

Discussion in 'ASP .Net' started by mavrick_101, Jun 9, 2010.

  1. mavrick_101

    mavrick_101 Guest

    Hi,

    Sorry for this stupid question. I'm trying to set up number of columns based
    on the values in a string array.

    for example I have this array:
    string[] tmpArray = commaSeperatedStringValues.split(',');

    DataGrid.DataSource=tmpArray;
    DataGrid.Bound();

    When I do this, all the elements in the array are shown as rows in a signle
    column...

    Pls help.
     
    mavrick_101, Jun 9, 2010
    #1
    1. Advertising

  2. mavrick_101

    Rajeev Gopal Guest

    On Jun 9, 10:34 am, mavrick_101 <>
    wrote:
    > Hi,
    >
    > Sorry for this stupid question. I'm trying to set up number of columns based
    > on the values in a string array.
    >
    > for example I have this array:
    > string[] tmpArray = commaSeperatedStringValues.split(',');
    >
    > DataGrid.DataSource=tmpArray;
    > DataGrid.Bound();
    >
    > When I do this, all the elements in the array are shown as rows in a signle
    > column...
    >
    > Pls help.


    Hi Mavrick,

    You may want to try with Multi-dimensional arrays instead.

    Thanks,
    Rajeev
     
    Rajeev Gopal, Jun 10, 2010
    #2
    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. Luis Esteban Valencia
    Replies:
    7
    Views:
    568
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Sep 29, 2004
  2. Replies:
    2
    Views:
    17,298
  3. rob thomson
    Replies:
    0
    Views:
    264
    rob thomson
    Sep 4, 2003
  4. ton
    Replies:
    2
    Views:
    207
    Alvin Bruney [MVP]
    Feb 11, 2004
  5. John Walsch
    Replies:
    0
    Views:
    202
    John Walsch
    Jul 9, 2004
Loading...

Share This Page