Created an aspx pageCopied WebSchedule2.mdb to App_Data folder as instructedAdded Access Data SourceConfigured data source - ~/App_Data/WebSchedule2.mdbFollowed all instructions in "Connecting WebSchedule to a Database in Visual Studio 2005"
Followed instructions in "Using the WebSchedule Controls Quick Design"Added WebScheduleInfoAdded WebScheduleOldDbProviderSet DataSourceId to AccessDataSource1Added WebCalendarViewAdded WebDayViewAdded WebMonthViewSet WebScheduleInfoId to WebScheduleInfo1 for all threeOpened WebSchedule2.mdb and added 3 activitiesViewed page in browserClicked on dates where I added activites. Nothing displaysSuddenly I'm getting the following error
Line 13: DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand=";"></asp:AccessDataSource>Line 14: Line 15: <igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" Line 16: DataFetch="WebScheduleOleDbProvider1" DataUpdate="WebScheduleOleDbProvider1" Line 17: StyleSetName="" StyleSetPath="" StyleSheetDirectory="">
Sometimes when adding controls it claims there are duplicates when there are no duplicates. Eventually this error goes away.
What am I doing wrong?
Also, are there instructions on how to maintain the WebSchedule2.mdb Access Database? Assuming I get it to work.
Thanks
I'm not sure I was 100% clear with the error I'm getting. Here is additional information.
Error Creating Control - WebScheduleInfo1 Cannot create an object of type 'Infragistics.WebUI.WebSchedule.IDataFetch' from its string representation 'WebScheduleOleDbProvider1' for the 'DataFetch' property.
Thanks, Jim
Also, As soon as I make any type of change I get the following error on everey one of these controls.
"Duplicate Component Name" But when I do a search I don't have any duplicates. Eventually this error goes away, sometimes when I close Visual Studio and open it back up. Very strange.
Hi Steve,
I just got yoru email while sending you one. I'll take a look at the one you just sent now. I just need to get one page to update the calendar and the other to be view only.
Thanks for all your help.
Jim
Hey Jim,
Im glad we finally got this going. Make sure you are using AccessDataSource and make sure that they both point to the Same access mdb file if you want one to update the other. Then they should be synchronized.
Sorry for all of this confusion with the WebSchedule and I hope this never happens again. Any other problems on this, let me know.
Both do point to the same AccessDataSource but they don't display the same data.
I decided to create a new page adding AccessDataSource, WebScheduleInfo, WebScheduleOldDBProvider, WebCalendarView, WebDayView and WebMonthView.
I start out witht the AccessDataSource and ConfigureDataSource to WebSchedule2. That worked ok and I could see all the appointments that I had entered when doing a test.
Then I added the WebScheduleInfo and WebScheduleOldDBProvider and the WebCalendarView and viewed in Browser. It opened ok but I could not see any of the data.
Then I went back to add the WebDayView and got errors on AccessDataSource, WebScheduleInfo and WebScheduleOleDBProvider claiming they were duplicates even though it just worked a few seconds ago and I had not touched them. I have had this same problem many times right from the beginning claiming these were duplicates when they were clearly not duplicates. It is maddening and reslly frustrating. I think this is a VisualStudio problem not an Infragistics problem.
Then it locked up my computer and somehow wiped out my link to my stocks in IE. I know that has nothing to do with Infragistics but I'm about ready to throw the computer out the window.
Sorry for the rant. I'll try again after fixing on stock list and report back.
Steve,
I'm really sorry I'm taking so much of your time but I'm still having difficulties and feeling really frustrated.
Your page ScheduleForm.aspx displays the 2 activities I entered from your page dates 11/17 and 11/19My new page displays the 2 activities I entered with my old page, the same as what was displaying with the old page until I dinged it up.Attached is an export from the database.My page doesn't display any of the activities in the database so I have no idea where they are coming from and I only have one databaseYou page doesn't display the 3 activities I created earlier that are in the database.If I add these 2 lines from your WebScheduleInfo to mine it doesn't change anythingAppointmentFormPath="~/WebSchedule/AppointmentAdd.aspx"ReminderFormPath="~/WebSchedule/Reminder.aspx"
This is from your page ScheduleForm.aspx<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScheduleForm.aspx.cs" Inherits="CherryHillFirst.ScheduleForm" %>
<%@ Register assembly="Infragistics4.WebUI.WebScheduleDataProvider.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Data" tagprefix="ig_scheduledata" %><%@ Register assembly="Infragistics4.WebUI.WebSchedule.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebSchedule" tagprefix="igsch" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> </div> <ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1" runat="server" WebScheduleInfoID="WebScheduleInfo1" DataSourceID="AccessDataSource1"> </ig_scheduledata:WebScheduleOleDbProvider>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]"> </asp:AccessDataSource>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server" AppointmentFormPath="~/WebSchedule/AppointmentAdd.aspx" ReminderFormPath="~/WebSchedule/Reminder.aspx" EnableRecurringActivities="True" StyleSetName="" StyleSetPath="" StyleSheetDirectory=""> </igsch:WebScheduleInfo>
<igsch:WebMonthView ID="WebMonthView1" runat="server" style="top: 0px; left: 0px" WebScheduleInfoID="WebScheduleInfo1"> </igsch:WebMonthView> </form></body></html>
This is from my new page CalendarView1.aspx%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CalendarView1.aspx.cs" Inherits="CherryHillFirst.CalendarView1" %>
<%@ Register Assembly="Infragistics4.WebUI.WebScheduleDataProvider.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.Data" TagPrefix="ig_scheduledata" %>
<%@ Register Assembly="Infragistics4.WebUI.WebSchedule.v10.3, Version=10.3.20103.1013, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.WebSchedule" TagPrefix="igsch" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/WebSchedule2.mdb" SelectCommand="SELECT * FROM [Activity]"> </asp:AccessDataSource>
<igsch:WebScheduleInfo ID="WebScheduleInfo2" runat="server" StyleSetName="" StyleSetPath="" StyleSheetDirectory=""> </igsch:WebScheduleInfo>
<ig_scheduledata:WebScheduleOleDbProvider ID="WebScheduleOleDbProvider1" runat="server" WebScheduleInfoID="WebScheduleInfo2" DataSourceID="AccessDataSource2" StyleSetName="" StyleSetPath="" StyleSheetDirectory=""> </ig_scheduledata:WebScheduleOleDbProvider>
<table> <tr> <td> <igsch:WebCalendarView ID="WebCalendarView1" runat="server" WebScheduleInfoID="WebScheduleInfo2"> </igsch:WebCalendarView> </td> <td> </td> <td> <igsch:WebDayView ID="WebDayView1" runat="server" WebScheduleInfoID="WebScheduleInfo2"> </igsch:WebDayView> </td> </tr> </table> <br />
</asp:Content>
I haven't given up, just slightly frustrated. I copied it to my laptop to see if there was anything different, a long shot I know, and it behaves almost the same.
But I did notice when I opened the database that the ActivityResource table only has entries for ActivityId 4 & 5 from the Activity table so that's probably why activities 1, 2 and 3 from the Activity table don't show up in ScheduleForm.aspx. ActivityId looks like it is the foreign key in ActivityResource table for Activity table. ActivityId 4 and 5 are the 2 activities I added from the ScheduleForm page and 1, 2 and 3 were added a while earlier from prior testing. I may have manually added them in the database but I don’t remember. But if that’s the case it would solve that problem since I would not have added entries in the ActivityResource table.
Still don't know why 4 and 5 don’t show up in CalendarView1.aspx. On the desktop the 2 activities I added from my old Calendar.aspx show up in my new CalendarView1 page but they don’t appear in CalendarView1 page on the laptop. But when I add one in CalendarView1 on the laptop it appears in the calendar on the CalendarView1 page but not in the calendar on the ScheduleForm page. This is the same behavior that I’m getting on the desktop. I have no idea where the activity is being stored in CalendarView1 because it is not in the database and I only have 1 database.
I’ll keep trying and let you know when I find an answer. But once I figure out how to get them synchronized I will still need to find a way to have one be updatable and the other view only or I won’t be able to use it since I cannot let the general public update the calendar.
You are probably getting tired of me by now but I’m getting close and don’t want to throw away all my effort and all your help by giving up.
I followed all your instructions and even have ig_res in my project. I have 2 pages, CalendarMaint.aspx (to update the calendar) and CalendarView.aspx (for view only). I only made the changes in CalendarView.aspx and then everywhere else that was not specific to either of those. I checked everything carefully and tested with FireFox, Chrome and IE8.
Both CalendarMaint and CalendarView work the same with all tests.
Here is what I get with Firefox
Get the Reminder popup when I open the page
Click on Open Item
Click on Save and Close
It doesn’t add anything but I get “Transferring data from local host” at the bottom of the popup page but nothing happens, so I close the popup
I then click on a date and it doesn’t open anything
With Chrome
I don’t get the Popup
Click on a date, nothing happens
With IE8
Got this error
Object expected AppointmentAdd.aspx?ReadOnly=true,line27 character 39
Line: 27
Error: Object expected
<body class="FormBackground" onload="AppointmentAddLoad()" style="overflow:hidden;PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px;
When I tested your project
In FireFox and IE8
No popup
Click on a date, popup opens
Save and close, nothing is saved and the popup closes
In Chrome
Nothing happens when I click on a date.
Maybe I still have MasterPage issues?
Ok. There are a few things to go over. I wanted you to handle the ActivityDialogOpening and ReminderDialogOpening ClientSideEvents of the ScheduleInfo control. The properties you are trying to set do not exist.
I attached my sample again so you can see it.
1). Look at the use of the ClientSideEvents of the ScheduleInfo control. This is how you stop the dialog from opening. Just handle the event and call oEvent.cancel = true.
2). Now to make it readonly, I gave you a function inside of the ig_addAppointmentDialogForm.js called DisableElements(); It gets called from the end of the InitializeValues function. Inside of DisableElements, I get all the controls on the page and set them to be disabled.
I inject a little markup into the page that tells me whether or not to disable the elements or not. Here is that line of code.
ClientScript.RegisterClientScriptBlock(this.GetType(), "ReadOnly", "<script>var IsDialogReadOnly=true;</script>");
You can do this however you want. This was just easy for me. I then check for that inside of the InitializeValues function to let me know whether or not I should call my diable function. I use the dialogInterface object which i get for free from using the schedule dialogs to get back to the opener window so I can ge the javascript I injected on that page.
if (dialogInterface._openerWindow.window.IsDialogReadOnly) { DisableElements(); }
Thats it. Now all elements are disabled. Check out the sample. Add an ig_res folder to the project so you have some styling. That folder is too big to attach.
Todd helped me so no problem that you were called away. I should have remembered to fix the build on my own anyway.
The one page I have is ok. I will either not put it in the menu or password protect it or both so only a few people can make updates.
I’m not sure yet for the view only if I will be using several controls such as the WebCalendarView and WebMonthView or some other one in a view only page or just use the WebCalendarView on the home page. I’m going to have 2 sites where I use this and each may want something a little different. But I think either way they should work the same.
I think the cleanest thing would be to not popup the dialog when logging on or opening the view page but just see the control(s) and then be able to click on a day (bolded in the WebCalendarView if there is something there) or a day in the WebMonthView so they can get the popup to see the details but not let them update anything. I suppose it would be nicer not to let them enter anything but disabling the save button would be ok as well if that is easier. Of course they can still click on an empty day as long as they cannot update anything.
I tried adding the ActivityDialogEvent and ReminderDialogOpening and I still get the Reminder popup when opening the page. I would prefer not to have it automatically popup, especially if I have the WebCalendarView on the home page.
Hopefully deploying to GoDaddy and connecting to the database will not be a problem. I’ve done that successfully with SQL Server for a Microsoft control.
My next adventure is to retake C# training to improve my skills so I don't have to ask so many questions.
<td>
<igsch:WebCalendarView ID="WebCalendarView1" runat="server"
WebScheduleInfoID="WebScheduleInfo1"
ActivityDialogEvent="True"
ReminderDialogOpening="True">
</igsch:WebCalendarView>
</td>
<igsch:WebMonthView ID="WebMonthView1" runat="server"
style="top: 0px; left: 0px" WebScheduleInfoID="WebScheduleInfo1"
EnableMultiResourceCaption="True" Height="500px"
MultiDayEventFromArrowCaption="" MultiDayEventToArrowCaption=""
StyleSetName=""
StyleSetPath="" StyleSheetDirectory="" Width="500px"
EnableAutoActivityDialog="False"
</igsch:WebMonthView>
Sorry about Thursday. I had an emergency consulting engagement to attend.
So, the WebMonthCalendar is not the control that you want to use. it is not part of the WebSchedule suite of controls. It is strictly a navigational/picker control. To be with the Schedule Suite, it has to have View on the end of the control name. DayView,WeekView,MonthView, and CalendarView. So, you will still need to use one of those controls.
And for the read only portion, there are many ways to do this. Do you want the dialog to just not open. This would be accomplished by handling the clientside events ActivityDialogOpening and ReminderDialogOpening. You can just return true in there and the dialogs wont open.
If you want to have the dialogs open, you can hide or disable the save button so you will never be able to save anything. This will still let you modify things in the dialog, but you will never be able to save.
Then of course, there is traversing the dom of the page and disabling all the controls on there so you will never be able to change anything.
Either of the last two days will require some custom javascript, but should not be too bad.
Please let me know what approach you would like to take.
I'm still trying. I found another control, WebMonthCalendar. I like it and it has a view only option but I don't see any way to connect it to the database or maintain appointments. But there must be a way if it has view only.