Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I program a visual task scheduling tool?

Status
Not open for further replies.

CosmicCharlie

Programmer
Jun 30, 2006
44
0
0
US
I am writing a module that schedules tasks for employees, and client limitations prohibit using Outlook/Exchange or third party tools. I have a user control that represents one occurence of a given task, and I want to effect the scheduling of the task by dragging the control over a grid showing employees on the vertical axis and days on the horizontal. When a user drops a task user control on the grid, the program will detect the employee and day and automatically assign that task for that employee at that time.

I have tried without success to drop the control onto a GridView so that the object represented by the user control is assigned to the cell. I am looking for any other approach that might work. My directions state that it is essential that this be a visual drag/drop operation.

If anyone has another suggestion for how this might be done (specifically, what other types of controls can I use for the grid) I am happy to know. Thank you.



Cosmic Charlie
 
You can draw your own control using a panel and then calculate what "cell" it's in via mouse position and number of rows/columns.

This takes some work and some fun math :)

 
Thank you, JurkMonkey. I appreciate your response very much. I have posted three versions of this question in two different forums, and yours is the first response I have received.

What you suggest is, in fact, the very solution that I have been hoping to avoid. I thought about that early on, but figured that there HAS to be a control in existence that would support this. No luck, thus far, and I as soon as I arrive at this task on my schedule, it looks like I'll be doing a lot of fun math!

N





Cosmic Charlie
 
Yes. I am limited to what is available in Visual Studio and DevExpress. I neglected to mention DevExpress, but the project I am working in uses it to manage data access and also uses a number of its controls. I could find nothing in DevExpress that would do this.

My first attempt involved trying to do a drag/drop on a gridview control, but I couldn't figure out how to detect what cell was under the pointer when I did the drop and abandoned that approach. If you know of a good way to do that, please do tell.

Cosmic Charlie
 
do you know about DevExpress XtraScheduler. For the requirements you mentioned, you would still have to do a lot of work if you decide to use this. But this should save you a lot of work.



Ch Saj
 
Thank you, Ch Saj. I'll take a look at that again. On first look it didn't appear to meet my needs, but perhaps I overlooked something. If you have any suggestions or can point me in a good direction, that would be very helpful.

Cosmic Charlie
 
Dont know the details but the main idea would be:

Enable the above scheduler control to accept the drag and drops. For this, you will have to find some property on the scheduler which will accept drag and drops.

Once you have done that, you then need to handle the event (of scheduler) which is invoked just after a drag and drop has ended and do your processing in that event. These events are named something like "AfterDragEnded", etc.

I would keep the employee names in a separate control (like a flyout) and drag and drop them onto scheduler.

Hope this helps

Ch Saj
 
When contemplating buy vs. build, buy almost always comes out cheaper.

Calculation:
- Take your annual salary
- Divide by 2080 (number of work hours in a year)
- Multiply by 1.4 (employee benefits cost money too)

That's your hourly cost to the company.

Now multiply by the number of hours it will take you to design, code, and test this usercontrol to the level where it's reliable and well-documented.

Comes out to a lot more than a 3rd party control, doesn't it?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Chip,

Your case is compelling ... just as it was when I made essentially the same case to the client. I still got the same answer: No third party tools. Not sure what their issue is, but I'm not the one writing the checks.




Cosmic Charlie
 
OK, didn't know this was for a client.
Nevermind.

(but maybe you can present this info to them again?)

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top