3

I am working on ASP.NET3.5. I have to present mention Dataset on GridView under the given format at the run time.

Datset

EMP_ID  EMP_NAME            2011-01-01_FLAG     2011-01-01_INDATE   2011-01-01_INTIME   2011-01-01_INSTATUS 2011-01-01_OUTDATE  2011-01-01_OUTTIME  2011-01-01_OUTSTATUS
1        Mr Netra Thapa         ATTN             2011-01-03          09:01:59             EI                 2011-01-03          18:0:15            
2        Mr Luja Manadhar       ATTN             2011-01-03          10:15:00             LI                 2011-01-03          17:0:15               EO  
3        Mr Kushal Joshi        ABS              NULL                NULL                   NULL            NULL                      NULL             NULL
4        Mr Prakash Gobhaju     ATTN             2011-01-03          09:00:15               NULL             2011-01-03         18:30:15               EO

I Have to present This Data using DataGird on the bellow format

Employee Id Employee Name                     01-01-2011    
                                     In Time        Out Time         Remarks    
1             Mr Netra Thapa        09:01:59       18:0:15          Earlry In
2             Mr Luja Manadhar      10:15:00       17:0:15          Late In , Early Out
3             Mr Kushal Joshi                        Absent
4             Mr Prakash Gobhaju        09:00:15       18:30:15         Late Out

How is it possible ?

netraThapa
  • 379
  • 2
  • 3
  • 8

2 Answers2

0

If I understand correctly, you need to format your dataset in two ways:

  1. Set description of the header rows. Use the "HeaderText" property of your fields in your columns for that purpose.

  2. Format / override some information:

For simple modifications, you may use the TemplateFields, as described for example here: http://www.c-sharpcorner.com/UploadFile/raj1979/GridViewExamplesForASPNET2009162008055815AM/GridViewExamplesForASPNET20.aspx

For more complex ones I recommend using the RowDataBound event handler, as described on the bottom of this page: http://msdn.microsoft.com/en-us/library/aa479342.aspx

bonifaz
  • 588
  • 3
  • 16
0

First bring remarks field in your dataset according to time difference. You can use case in SQL Server. In gridview columns take a templated field and make structure according to your need.

Sandor Drieƫnhuizen
  • 6,310
  • 5
  • 37
  • 80
Mohan
  • 907
  • 5
  • 22
  • 45