|
Rank: Newbie Groups: Member
Joined: 3/2/2012 Posts: 8
|
Hi,
I need to use the calendar's "editable scheduler" design in a fashion that provides for a site administrator role (manually or via SQL Svr tables) to populate selected days with events - and modify and delete. I need the end users to see the events and then click on them to get additional information about the event. The end user must be "read only".
I have the demo code in my VS 2010 environment and can run the demos and see the code in "source" mode. However, switching to "design" mode doesn't actually show the calendar control.
I'm looking for a "plan of attack" and any code samples. I assume I need two separate calendars: one for the administrator and one for the end user. The "editable scheduler" sample appears to be the choice for the administrator. Although, I would ultimately like to drive this process by populating the calendar from the DB - is there a good sample for this?
I've not seen a sample that addresses my needs for the end user. All I really need is to handle the click on a given event and then pop up a message box with the event name plus other information stored in the DB. Are there any samples to help me with this?
Thanks for your help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Thanks for posting in the forum. It appears that you are still a bit far from your project goal. We will help you on questions that are:
1. Strictly related to our product; 2. Generic in nature;
Specifically, we WILL NOT give you a plan of attack to your particular scenario. We will give you some general instructions, but we will not give you anything particular related to your specific scenario. In another word, we tell you how our product works, but we won't help you on implementing your project. This policy is necessary for us to avoid abuse.
As to your question:
1. Administrator/User ---- The Calendar neither cares nor understands your user. From the Calendar point of view, if you want to disable it, you set the control's Disabled to true. Based on what logic to determine whether you should set the control's Disabled is completely up to you. Whether to use one or two Calendar control would be completely up to you too. We do not advise on that;
2. Populating from database --- The Calendar does not interact any database directly. For the particular sample you are interested, you will need to handle the Calendar's DayRender event. The DayRender event is called for each "day cell" and is responsible to fill the contents in each day cell. Again how to pull data in your database and use that data to drive your DayRender event handler to behave differently for different day cells would be completely up to you;
3. Handling click event ---- The Calendar handles click event by default if you only meant to "select" that date. In your case obviously you will need to save things back to the db. That logic is again done in the code rendered by DayRender event. The sample code you are looking for demonstrated one way to do it. However that is only meant to demonstrate what can be done with "custom code". You will need to understand that code and adapt it accordingly to fit your own application;
Hope this helps. I aplogize that we as a component vendor will not be able to analyze your specific business scneario and provide a "sample code" that does everything you wanted to do. You must understand that in reality there are millions different programmers all with a different business scenarios. So if we were to produce a sample for each of them, we would be doing their job. As such we do not do that.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/2/2012 Posts: 8
|
This is an Update on my trying to figure out this control:
I moved the "editable scheduler" demo into a test page and have figured out where to trap the notes keyed into the calendar (wrote them to a flat file):
Protected Sub CallbackPanel1_Execute(sender As Object, e As EO.Web.CallbackEventArgs) Dim callbackParam As String = CallbackPanel1.LastTrigger.Parameter
'Validate the parameter. The first 10 characters 'is the date. The rest is the note. If Not (callbackParam Is Nothing) AndAlso callbackParam.Length > 10 Then Dim [date] As String = callbackParam.Substring(0, 10) Dim note As String = callbackParam.Substring(10)
Notes(EO.Web.Calendar.StringToDate([date])) = note
'Using notelist As StreamWriter = File.AppendText("C:\webdev\notes.txt") ' Dim mydate As String = callbackParam.Substring(0, 10) ' notelist.WriteLine(mydate) ' notelist.WriteLine(note) 'End Using End If
However, I don't know how to populate notes into the calendar when it is being rendered. I can see that the particual day is developed as: table id="dayId_2012_03_01" in this code:
Protected Sub Calendar1_DayRender(sender As Object, e As EO.Web.DayRenderEventArgs) Dim note As String = CStr(Notes(e.Day.Date))
'Create an ID for this day Dim dayId As String = "dayId_" + EO.Web.Calendar.DateToString(e.Day.Date) dayId = dayId.Replace("-"c, "_"c)
Dim html As String = "<table id=""{0}"" border=""0"" cellSpacing=""0"" cellPadding=""0""" > > > html = String.Format(html, dayId, backgroundColor)
e.Writer.Write(html) End Sub 'Calendar1_DayRender
However, I don't understand how to put notes into a calendar. I can read them from the flat file where I saved them and I have some idea how the date is constructed. But, I don't know to put this together.
Will greatly appreciate any help.
|
|
Rank: Newbie Groups: Member
Joined: 3/2/2012 Posts: 8
|
OK, I understand your policy.
I posted my "update" before I saw your reply.
However, If I can get past this one issue, I should be OK with the calendar. I just need to understand a bit more about how to insert a saved note when the calendar is being rendered. Hopefully this does not violate your policy. Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We can only tell you what DayRender event handler does. The code you put inside DayRender event handler is responsible for rendering contents for a specific day cell. So for example, if you have the following code:
if (e.Day.Date.Year == 2012) e.Writer.Write("It's this year");
Inside your event handler, then the Calendar will show "it's this year" for all day cells for the year of 2012, but empty for all other years.
The point of DayRender event is to instruct the Calendar to give you empty day cells so that you can fill them up with whatever you want based on your own logic.
This is as much as we can help you on how to use DayRender event. You will need to figure out how to do the rest. We will not be writing a note management application for you.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/2/2012 Posts: 8
|
eo_support wrote:We will not be writing a note management application for you. I guess I missed the part where I asked you to do this. I'm just trying to figure out the culture here and you have lectured very clearly about what you won't do. So, I'm in the learning stage. I might remind you that you published this in your "why choose us": Extensive Documentations . EO.Web Controls documentation is not just an automatic generated reference like others. The online document contains not only full reference, but also a large collection of guide and walkthroughs. Perhaps I'm missing something but where is the Calendar-Scheduler walkthrough? This was a primary reason I bought your package. Here is my basic problem (and hopefully I just don't understand something about your extensive documentation): If I use the Microsoft provided calendar and look up an event or property they provide code sample for how to accomplish a task. I've been digging through your documentation and it does not appear that you have code samples attached to your event descriptions. For example, I've been looking at your documentation for Day Render Event. Your sample programs are helpful but hardly a direct way to get at the functionality in your controls. I understand your concern about being abused, but really, is it a great chore to provide a small sample showing how to use the Day Render Event to populate specific days with some clickable text that can be responded to?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I understand your frustration. But you have to understand if we say yes to you, then we will have to say yes to thousands of other customers who would be very happy to see us to write an exact "sample" code for them to do whatever they wanted to do. What we are trying to say is there is a clear line between our job and your job and we cannot afford to do your job for you. If the line is not clear to you then we will try our best to explain. This is not about lecturing you in any way.
I can tell you very frankly that we've been in this business for many years and it's always those who know the least about programming that complain about our documentation the most. I am not saying there is no room for us to improve, in fact there always are rooms to make things better; However most of the time they are looking for something that does exactly what they wanted to do so that they can just copy it from our documentation without really understanding what they are doing. When they cannot find it, they would say our product lacks detailed documentation.
I am not categorizing you along with them but you have to understand that we will not get into your particular project/task at hand. Like I said, if we do it for you, we would have to do it for others; If we do it for you today, tomorrow you have a different project you would expect us to do it for you again. Not only we cannot afford to do that, but also it does not do us any good. Most likely you would be 10 times angrier if we were to look into your project to help you out 10 times and then decided to stop one day because you’ve already taken it for granted at that point. At here we do not want to give any false impression about this. So we will tell you up front we won’t do anything particular related to your project/task.
Once again, we have no intention to “lecture” you in anyway. We just wanted you to clearly understand what we will do and what we will not do for you. Our position is you have to understand your own code, regardless it comes from our samples or elsewhere. If you do not understand the code, we will do our best to explain if the code is directly related to a feature of our product (for example, in this case we explained to you what DayRender event does). But we are not in a position to teach you .NET or ASP.NET or anything generic in nature about programming; nor will we write anything specifically for your project. That’s why we will only explain what DayRender does to you and won’t explain other code to you. If you have trouble understanding the rest of the code, you will have to find someone else to help you out. We are very firm on this so please take this as our final word on this issue.
Hope this clears up any confusion about our support policy. If this does not meet your expectation, we will be very happy to issue a full refund to you so that you can try your luck with someone else. Please just let us know.
Thanks
|
|