I need to create a user control, that will be used in an application used to schedule employees tasks. The control will be a two dimensions table. There will be one line for each employees. On this line, there will be 0 or more block that each represent a task this employees has to do. They will be ordered from left to right so the ones on the left will be the ones that need to be done next. Since this table will contains lot of employees and task for a couple of days, the control will need to scroll both horizontally and vertically.
I was thinking of having 3 kinds of control.
- The grid itself
- An employees tasks (a row)
- A task (each blocks)
Now, when the users scroll horizontally or vertically, I need the headers to stay visible and it’s not trivial if I separate controls as I did.
So, I guess my questions is, how would you design such a control? Would you create a single control that does everything or separate it in multiple controls as I intend to? Would you manage the scrollbar programmatically or would you simply use the AutoScroll properties of the control?
I would create a single user control. I would consider creating multiple user controls only if there was significant re-use possibilities for the individual controls. Keep in mind that it takes extra effort to communicate among user controls using events and delegates. In this case, it appears that the controls need to be tightly integrated.
I would use the AutoScroll property if it meet my needs.