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. Advertisements

  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. 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. Henrique Berenguel

    How to show monetary values in a DataGrid

    Henrique Berenguel, Jul 1, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    2,106
    Henrique Berenguel
    Jul 2, 2003
  2. Luis Esteban Valencia
    Replies:
    7
    Views:
    714
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Sep 29, 2004
  3. Replies:
    2
    Views:
    17,450
  4. Replies:
    1
    Views:
    570
  5. rob thomson
    Replies:
    0
    Views:
    451
    rob thomson
    Sep 4, 2003
  6. dalbo

    DropDownList show the name of columns of dataGrid

    dalbo, Aug 24, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    7
    Views:
    207
    Eliyahu Goldin
    Aug 24, 2005
  7. ton
    Replies:
    2
    Views:
    335
    Alvin Bruney [MVP]
    Feb 11, 2004
  8. John Walsch
    Replies:
    0
    Views:
    388
    John Walsch
    Jul 9, 2004
Loading...