locked
Single Line view from many columns data ASP.NET GRIDVIEW RRS feed

  • Question

  • User-47788187 posted

    Hi,

    My table look like this ,

    creation_date event_name person_num full_name
    7/21/2016 18:00:00:00 PM CLOCK_IN 40014 OSU
    7/21/2016 19:00:00:00 PM CLOCK_OUT 40014 OSU
    7/21/2016 20:00:00:00 PM CLOCK_IN 40014 OSU
    7/21/2016 21:00:00:00 PM CLOCK_OUT 40014 OSU
    7/21/2016 21:10:00:00 PM CLOCK_IN 40014 OSU
    7/21/2016 21:30:00:00 PM CLOCK_OUT 40014 OSU

    How to display in gridview like this

    creation_Date person_num full_name CLOCK_IN1 CLOCK_OUT1 CLOCK_IN2 CLOCK_OUT2 CLOCK_IN3 CLOCK_OUT3 HoursWorked
    7/21/2016 40014 OSU 18:00 19:00 20:00 21:00 21:10 21:30 2.2

    Thank you....

    Friday, October 14, 2016 8:25 AM

Answers

  • User-1838255255 posted

    Hi  av2020,

     

    According to your description , As far as I know ,

    1. you can get data from database . then in code behind , make a modify , get ‘event_time’ value , then insert in table fixed column , according old tables ’event_time’ index , then get value of ‘creation_date’ and insert in corresponding event_time’s column.
    2. If your data format is not fixed , I suggest you use nested gridview . I find a sample for your reference!

    Nested GridView Example in ASP.Net using C# and VB.Net:

    http://www.aspsnippets.com/Articles/Nested-GridView-Example-in-ASPNet-using-C-and-VBNet.aspx

     

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 18, 2016 8:32 AM

All replies

  • User-47788187 posted

    hello gridview experts any suggestion pls..

    Saturday, October 15, 2016 7:31 PM
  • User-1838255255 posted

    Hi  av2020,

     

    According to your description , As far as I know ,

    1. you can get data from database . then in code behind , make a modify , get ‘event_time’ value , then insert in table fixed column , according old tables ’event_time’ index , then get value of ‘creation_date’ and insert in corresponding event_time’s column.
    2. If your data format is not fixed , I suggest you use nested gridview . I find a sample for your reference!

    Nested GridView Example in ASP.Net using C# and VB.Net:

    http://www.aspsnippets.com/Articles/Nested-GridView-Example-in-ASPNet-using-C-and-VBNet.aspx

     

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 18, 2016 8:32 AM