I have a request from a client to create a new interface for some proprietary scheduling data we have in our SQL database.
The requirements are as follows:
The scheduling data needs to be laid out in a calendar format to be able to be viewed 1 day/week/2 week/month at a time and be able to switch between these views.Inside each day there needs to be detail and summary data. That detail and summary data can consist of multiple rows (tasks) and columns of data, all of which could have a custom format (text/back color) applied to them.They also want to see something like a progress bar as a background of each row that shows the percent completion of each task (row).
I was wondering if I could use an UltraMonthViewMulti or a UltraMonthViewSingle as the primary calendar control for this, possibly inject 2 wingrids to get the rows & columns (with formatting ability), but I am not sure if it would be the right way to go, or truly even how to accomplish this.
I appreciate any help or suggestions in this matter.
Seradex
Hi Seradex,
There are a number of approaches you could take here. UltraMonthViewMulti only shows numbers and doesn't really have any space for data within a day. But it sounds like using UltraWeekView and UltramonthViewSingle would be good for your purposes.
Showing complex content inside a day isn't something these controls support out of the box, but it should be possible with a little clever coding. Your idea of using UltraWinGrids inside the day would be pretty simple to implement, but whether or not this is a good approach depends on how much content you intend to display at once. If you have 30 or more days visible at a time and each day has 2 WinGrids in it, that's 60 or more grids on-screen at once and that probably won't be very efficient. You are likely to run into some performance issues.
Another approach you might take is to simply generate an image for each day. You could write a method that creates a Bitmap and draws the data you want directly into it with whatever layout and formatting you want. Or you could skip the image and use a DrawFilter to draw directly into the control. Both of these approaches assume that the contents of the day don't have to be UI interactive, though. If the user needs to be able to click on a particular item within a day and have something happen, then this probably isn't the way to go.
Another approach would be to use a CreationFilter and embed one or more UIElements into the day. You can't realistically embed a WinGrid into the control in this way, but you could embed a FormattedTextUIElement which provides functionality similar to RichText or Html. Or you could add a bunch of TextUIElements and some ButtonUIElements, and of course, a ProgressBarUIElement. You could even create a UIElement of your own that contains some combination of these elements and then re-use it. This approach is obviously the most complex and requires the most coding, but it's also the most flexible and it should be efficient enough so as not to cause performance issues with your application.
In fact, even if you decide to go with the grid approach, it would probably be a good idea to use the CreationFilter to position the grid(s) inside the days.
Whatever approach you take, you will have to decide what to do if the information for one particular day doesn't fit within the available space. Do you want a scrollbar? Or a sort've "more info" button that shows the details? Either of those could be achieved with a CreationFilter, but the Scrollbar approach is trickier, as you need to somehow keep track of the scroll position of each day's list.
I can't see any reason why any of this would not be achievable, but it's not trivial and will require some coding. Of course, I'd be happy to help you out with any of these approaches.
I was just notified this afternoon that my requirements have actually been reduced due to one client re-evaluating their needs. They think they will be going in a different direction.
Basically I no longer need multiple columns of data per row as the few pieces I need could be concatenated together as long as I can associate that with an ID that I can use to refer back to my SQL data. I also no longer need any summary data in each day.Note that I did see based on your response that I might have been able to do the summary data from the old requirement by using a few text boxes and labels embedded below the grid, but since it is no longer needed it helps to simplify things.
I still need the text/back color and a progress bar behind (underlying) the row basically as if the text was in the progress bar. There will be no need to edit this text directly.This is basically to display the status of scheduled items and show when it is occurring. It will also be required to allow them to move an item (row/task) to a different day/time. I thought this would be the least challenging thing as I have done drag & drop with Infragistics before (within a wingrid) and could present them with a pop-up date-time control for precise control.
Also, you are probably right that I would need scroll bars as the client may have more things than can be displayed in each day.
Does either UltraWeekView or UltramonthViewSingle allow me to present a single day view and a 2 week view, or would I need a different base control for the day view and 2 UltraWeekViews for the 2 week view?
Basically the client wants to be able to simply & quickly switch between these views similar to within Outlook Calendar. The intended look is to be similar to an enhanced Outlook Calendar with the Day, Week, and Month (with High Detail) views. The two week view would either be like two Outlook Week views stacked on top of one another, or like the high detail Month View that only shows 2 weeks.
The other concern I had was speed as I once tried to implement your Windows Forms Gantt control using our custom data and it ended up taking over 10 minutes to load the data into the Gantt including all of the assignments, etc., and that was with much less data than what our clients typically have. I believe it was because I was unable to load everything via binding, and am hoping that when I return to this that I will be able to do binding using perhaps your WPF Gantt control - but this is off topic.Basically it is ok if the UI takes up to a minute to initialize, but each time frame's data must be loaded in very quickly.
Also, I completely expected that very little of this would be trivial (if anything).
I was wondering if these controls already have the ability to show a list of items similar to how Outlook does? Note that I have looked around in the documentation, but am having a hard time figuring it out with the short timeline I was given to come up with a design. Is there a sample project you could direct me to that illustrates the abilities it has as that could be very helpful. Note that development is not scheduled to begin until about two weeks from now.
I hope this was helpful to simplify and clarify things.
I greatly appreciate your assistance with this.
Hi,
Which Style Library (isl file) are you using? Is it one of the ones we provide or did you create your own?
Style Libraries override any settings on the control. This allows you to load one into an existing app and have it override any appearances you already set.
So if you want to use an isl and also set some colors in the app, you have two options.
1) You can modify the isl file so that it doesn't set those colors - thus the isl will not override the app settings so you can set those colors in the application.
2) Set the colors you want in the isl file itself.
I'm afraid I can't tell you off the top of my head exactly which properties you need to set in the isl to achieve what you want. The resolution process is quite complex and the override could be coming from any one of a dozen different objects. What I usually do in situations like this is I run AppStylist and go to the canvas that has the control I want. In this case, you would go to the schedule tab and find a DayView control.
Then mouse over the DayView and when the RoleTip comes up, you can press 'C'. This will bring you to the Control role for that control. On the bottom, you will see one or two property grids with properties applied to that control by the isl. You can try changing or resetting these to see if you get the effect you want. My guess is that a lot of the settings in the isl are applied via the ViewStyle or Style property.
If the control role doesn't help, you can try going back to the DayView and pressing the number '1'. This will bring you to the UIRole of whatever element you happen to have the mouse over. You probably want to have the mouse over an appointment when you do this, since that's what you are concerned with here. You can then Reset the entire UIRole and see what happens. This will tell you if that's where the colors are coming from. If not, you can walk up the parent chain and reset each role in turn to find the one you need by process of elimination.
If even the DrawFilter has no effect, then the problem might be that the control is drawing using OS Themes, but that seems unlikely, as all of our isl files turn off themes.
If you could send me a sample showing the problem and explain what you want to do, I could look into it further and try to point you in the right direction.
I have actually just been playing in the DataBound Calendar sample. This is where I have experienced this behaviour. I don't know what style library it uses, but I suspect it is a default one. I have attached my current version of that project (VB format) including the shared GetStyleLibrary.vb file to show that I have not changed the shared file. Currently the code to use a custom draw filter is commented out.
My concerns are as follows (when UseAppStyling set to False) in order of importance (first is most important). All of these can be seen in the screenshot from my previous post (left side of image has UseAppStyling set to False) 1. The description of the appointment shows the start & end time in the UltraDayView. - must change this back to only the description.
If not possible to do these then we can live with current behaviour. 2. The day header shows "Friday, November 20" instead of "Friday" centered and "20" at the left side. - Would be very nice to determine how to control this.
Nice to haves 3. Appointment border is black and square instead of same as back color and with rounded corners. 4. Day back color is aweful yellow instead of a nicer light green or blue like in office or light gray as in right side of screen shot.
Must not have the dark gray/black scroll bar as this is inconsistent with the rest of our application which uses the standard gray windows forms scroll bars.
My preference would be to do this via code instead of a stylesheet file (.isl) as my guess is that it would be easier to read & understand. Note that I am unfamiliar with the .isl format. If it is actually like web css (i.e. is a simple text file), and can be embedded in the dll, then this may be easier to use.
As always, I greatly appreciate all of your help with this.
Just to clarify... are you planning to use IG.Isl in your application? This is an Isl file that we use for our samples, but there's no reason why you need to use it in your application. You could use a different isl included with the Infragistics suite, create your own isl, or use no isl. Is there some reason why you are assuming that you will be using the same isl in your app that the sample is using?
If you are not going to use this Isl, then you might want to comment out this line of code in the sample:
Infragistics.Win.AppStyling.StyleManager.Load(islFile)
This way, the Isl is not loaded at all and you will see how the controls look without it.
At that point, you could either try to create an isl that gives you the look you want or try to get what you want via property settings in the application.
Anyway, regarding the 4 points you listed here, these all appear to be functions of the ViewStyle property. The ISL is setting the ViewStyle of the UltraDayView to Office2007. So you can either create an isl that does this or simply set the ViewStyle to Office2007 in code. The ViewStyle is a property on the UltraCalendarLook which is a component that all of the Schedule controls attach to, similar to the UltraCalendarInfo. So it will affect all of the controls.
It might be possible to achieve these settings individually (without setting the ViewStyle), but I'm not absolutely sure. Presumably, it would be done via some other properties on the UltraCalendarLook. I could check into it, if you need it.
Thank you very much.
It appears that this was exactly the info was looking for. I wasn't planning to use an isl file in my application. I just couldn't figure out how to get it to do what I wanted.
Preventing it from loading the isl file and setting the ViewStyle to Office2007 appears to have done the trick.
Thank you very much for all of your help, it is most appreciated.
Loading an isl file is basically just another way of setting properties on the controls. Or, to be more precise, it's another way of resolving the values of those properties (since it doesn't actually set the property value in most cases).
So with a few rare exceptions, the isl doesn't let you do anything that the control doesn't already do. It's just a question of finding the right property to do it. :)
Cool. Glad to hear it. :)
I just wanted to let you know that the information you provided was instrumental in achieving the desired goals. I managed to simulate the progress bar by manually drawing the back color for part of the appointment based on the percent complete of the task. I didn't require anything other than a static progress bar like indicator.