Pump data by row and column to dynamic created column in gridview

Discussion in '.NET' started by johnsonlim026, Feb 27, 2010.

  1. johnsonlim026

    johnsonlim026

    Joined:
    Feb 24, 2010
    Messages:
    2
    Likes Received:
    0
    I have data in table that need to display to user in such a format in gridview.

    Data format:

    -----------------------------------------------------------------------
    LineNo |DateDay |Date |Shift |Project No|ItemNo|ItemQty| AvailHr
    -----------------------------------------------------------------------
    1.1 |Monday |1/2/2010 |x1 |y1 | z1 | 100 | 0.5
    1.1 |Monday |1/2/2010 |x1 |y1 | z2 | 150 | 0.2
    1.1 |Monday |1/2/2010 |x1 |y1 | z3 | 120 | 0.3
    1.1 |Monday |1/2/2010 |x2 |y2 | z4 | 105 | 0.1


    2.1 |Tuesday |2/2/2010 |x1 |y1 | z1 | 100 | 0.5
    2.1 |Tuesday |2/2/2010 |x1 |y1 | z2 | 150 | 0.9
    2.1 |Tuesday |2/2/2010 |x1 |y1 | z3 | 120 | 0.7
    2.1 |Tuesday |2/2/2010 |x2 |y2 | z4 | 105 | 0.1




    Gridview Format:

    --------------------------------------------------------------------------
    | Monday | Tuesday
    --------------------------------------------------------------------------
    | 1/2/2010 | 2/2/2010
    --------------------------------------------------------------------------
    | X1 | X2 | | x1 | x2|
    --------------------------------------------------------------------------
    1.1 | ItemNo: z1 | Qty=100
    | ItemNo: z2 | Qty=150
    | ItemNo: z3 | Qty=120
    Ttl Avail Hr:1.0

    --------------------------------------------------------------------------
    2.1 | ItemNo: z1 | Qty=100


    I have 2 solution on this:

    (1). Create dynamic column for datatable that just suit to the gridview structure and then change the column header text accordingly when display to user.

    (2).Create dynamic column in gridview and pump data by row and column accroding to the gridview column header text.

    I prefer the second way to do it.but find no ways to pump in the data by row and column into the gridview.
    I have find ways to create dynamic column but no ways to pump in the data to gridview row by row.Does anyone has idea on this?
     
    johnsonlim026, Feb 27, 2010
    #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. Fernando Lopes
    Replies:
    0
    Views:
    3,376
    Fernando Lopes
    Apr 28, 2005
  2. H5N1
    Replies:
    0
    Views:
    2,982
  3. davemitc@gmail.com
    Replies:
    63
    Views:
    15,779
    christhevet
    Mar 20, 2011
  4. maurban@gmail.com
    Replies:
    5
    Views:
    858
    maurban@gmail.com
    Oct 13, 2006
  5. Keith G Hicks
    Replies:
    3
    Views:
    992
    Keith G Hicks
    Feb 18, 2008
  6. Ken Fine
    Replies:
    4
    Views:
    583
    Steven Cheng [MSFT]
    Jul 14, 2008
  7. bsm

    Dynamic GridView with Dynamic Column

    bsm, May 15, 2007, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    973
  8. D
    Replies:
    0
    Views:
    500
Loading...