0

So I have a view(an actual database view) that contains all the tasks that an employee of my company has completed. Each task involves doing something over a period time. So it could label boxes. We have several different task that are repetitive, so each day we create a record for the task. So you could have label boxes at a rate of 300 boxes. That would become a record, tomorrow would be a new record and if you did a different task that day it would be another record added. Some people may have been done 50 different tasks (so up to 50 records a day) over the course of the year or may have done the same task for 40 hours a week every week for a year(so one record each day).

The plan would to have a grid view that over a set show the rate of which each task was complete over an year. The gridview would look like this:

Person's Name | Task1 | Task2 | Task3 |...
Person 1      | 300   | 350   | 60    |...
Person 2      |...
...

My plan was to just build a class and after reading the database initialize each class with the person's name and totals for each task, add that to a list of the class then bind that to the gridview. However a manager can create a new task when they need to or a person may not have every task. What is the easy way to go about filling a gridview with this view?

1
  • 1
    If you're going to want to display it like this AND allow someone to add tasks to it, you might not be able to simply use a gridview and bind it to a datasource since the datasource is going to give a literal result set and it would be ridiculous to have a column per task. Maybe consider a listview. In the layout template, set the columns, then set the data via the item template. Also, if you keep adding tasks, your grid is going to grow indefinitely to the right. Maybe rethink the UX? Oct 17, 2012 at 23:21

1 Answer 1

0

Run your SQL select statement, fill a dataset and bind to gridview.

2
  • Wouldn't that mean each task would be it's own column? What if we delete 3 tasks and add 20? :o/ Oct 17, 2012 at 23:23
  • IF its all in the database, you should have no problem running a nice SQL select statement that would build the column you need. You could even run entity framework and run a complicated select and have it return a complex type of the data you need. I might be understanding your question a little different. Maybe you can post some more samples?
    – bugnuker
    Oct 18, 2012 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.