Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
194 views

 

 

I am getting this error on the following code
The supplied instance is not of type Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable (ShopMaintenance.Scheduled+Task). Are you trying to add a wrong object or is the assembly not enhanced?

//Find all "Daily" tasks from the TaskPool table and populate the calendar with them

 

 

 

public static void Daily_Tasks(){

 

 

 

ShopMaintenanceEntityDiagrams context = new ShopMaintenanceEntityDiagrams();

 

 

 

IQueryable<TaskPool> query = from c in context.TaskPools

 

 

 

where c.Cycle == "Daily"

 

 

 

select c;

 

 

 

foreach (TaskPool taskpool in query)

 

{

 

 

int months = 12;

 

 

 

int days = DateTime.DaysInMonth(DateTime.Now.Year, months);

 

 

 

while (months > 0)

 

{

 

 

while (days > 0)

 

{

 

 

DateTime daily = new DateTime(DateTime.Now.Year, months, days, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);

 

 

 

switch (daily.DayOfWeek)

 

{

 

 

case DayOfWeek.Saturday:

 

 

 

break;

 

 

 

case DayOfWeek.Sunday:

 

 

 

break;

 

 

 

default:

 

 

 

Calendar.Appointments.Add(new Calendar(taskpool.ID, taskpool.Name, taskpool.Notes, daily, daily.AddHours(1)));

 

 

 

Task task = new Task();

 

task.Id =

 

Guid.NewGuid().ToString();

 

task.TaskName = taskpool.Name;

task.TaskNotes = taskpool.Notes;

task.Start = daily;

task.End = daily.AddHours(1);

context.Add(task);

context.SaveChanges();

 

 

break;

 

}

 

days--;

}

 

 

if (months >= 1)

 

{

months--;

 

 

if (months != 0)

 

{

days =

 

DateTime.DaysInMonth(DateTime.Now.Year, months);

 

}

}

}

}


Any thoughts? Thanks!


Eric

Eric Moore
Top achievements
Rank 1
 answered on 04 Oct 2010
2 answers
83 views

When I create a recurring daily appointment series that lasts for multiple days, it does not show up for all those multiple days. It almost seems like RadScheduler stops displaying the series of appointments past the week that it was created in. The RecurrenceRule text in the database however contains the correct and intended information. The same thing happens if I create a recurring appointment that ends on a specific date. It somehow shows for only the week it was created in event though the RecurrenceRule text in the database contains the end date that was assigned to the series. For example:

DTSTART:20100927T120000Z
DTEND:20100927T130000Z
RRULE:FREQ=DAILY;COUNT=15;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU
The series indicated by the RecurrenceRule text above appears on RadScheduler from 12:00 PM - 1:00 PM only during the week of the start date 9/27/2010 even though it should go beyond that.
Peter
Telerik team
 answered on 04 Oct 2010
3 answers
69 views
I'm using a master Appointments database table to store all appointments for RadScheduler that we use. That way I can share the same table whether it's a Dr. Appointment or a Vacation Schedule etc. I've added an "AppointmentType" column to the table to differentiate between appointment types. What I don't understand in this scenario is how to handle Resources. I don't want to store the ResourceType.ForeignKeyField in the master Appointments table because each type of Appointment may have zero to multiple Resources. I'd rather off-load Resources to another table so I don't clutter up the master Appointments table with FK Resource ID's for every possible Resource. Any ideas?
Peter
Telerik team
 answered on 04 Oct 2010
2 answers
416 views

Hi,  i try to update my Telerik DLL from "2009.1.402.20" to "2010.1.519.35" and having few issues, one of them is i try to open a RadWindow from my PageLoad event....

Everything is fine when i am open the RadWindow from a button but as soon as i try to open it automaticly from the page load event throught the RegisterStartupScript method i have an JS error " 'undefined' is null or not an object" see attachment for details

- Everything was fine with the previous version of the control
- Theres nothing in the code that could impact the functionnality because i use a brand new peoject with nothing else on it
- Doesn't matter if i am using the Window Script Manager or the RadScriptManager
- I suspect something in the control beacause in the JS error (see attachment) said error on line 3193... this it's weird because my html page result only have 148 lines....

To test this I have created a blank new WebProject and add the following code

 

Here's part of my CodeBehind Code :

 

 

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

 

    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "OpenDataSet", "ShowLanInsertForm();", true);

 

}

 

 

 

 

 

Here's part of my my HTML code :

 

 

 

 

<script type="text/javascript">

 

 

 

 

 

 

 

 

 

 

    function ShowLanInsertForm()

 

    {

        radopen(

 

 

"http://www.telerik.com", "RadWindow1");

 

    }

 

 

 

 

</script>

 

 

 



<

 

telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

 

 

 


<

 

button onclick="ShowLanInsertForm(); return false;">open</button>

 

 

 



 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">

 

 

 

 

<Windows>

 

 

 

 

<telerik:RadWindow

 

 

 

 

id="RadWindow1"

 

 

 

 

runat="server"

 

 

 

 

showcontentduringload="false"

 

 

 

 

width="400px"

 

 

 

 

height="400px"

 

 

 

 

title="Telerik RadWindow"

 

 

 

 

behaviors="Default">

 

 

 

 

</telerik:RadWindow>

 

 

 

 

</Windows>

 

 

 

 

</telerik:RadWindowManager>

 

 

 



Dany
Top achievements
Rank 1
 answered on 04 Oct 2010
1 answer
99 views
Hello,

I would like to add a footer template to a calendar control and then to add the new calendar,
to a RadDatePicker control.
i need to do it in the code behind (not in the aspx page).
My problem is to combine between the calendar control and the datepicker control in the code behind.

example:
the following code i would like to pass to the code behind.

 

<telerik:RadDatePicker ID="RadDatePicker10" runat="server" Width="140px" Skin="Forest">

 

 

            <Calendar ID="Calendar1" runat="server" Skin="Forest">

 

 

                <HeaderTemplate>

 

 

                    <div style="width: 100%; text-align: center; background-color: white;" >

 

 

                        <input id="Button1" type="button" value="Today" onclick="GoToToday()" />

 

 

                    </div>

 

 

                </HeaderTemplate>

 

 

            </Calendar>

 

 

</telerik:RadDatePicker>

Thank you,
Oren

 

Dimo
Telerik team
 answered on 04 Oct 2010
3 answers
118 views
Hi,

I need some advice on the best Telerik control to use.

I need a popup control that appears like a window that can appear dynamically and contain other server side controls.  I thought the RadWindow control would work but it doesn't seem happy containing other asp controls.  The other restriction is we have to use the telerik:RadScriptManager not the telerik:RadAjaxManager.

Any advice?

Thanks,
Geoff Ballard
Top achievements
Rank 1
 answered on 04 Oct 2010
5 answers
204 views
Hello I get the following error when pressing the 'Next Page' or 'Last Page' buttons on my radgrid. Pressing the page numbers works fine increasing PageSize works fine as well,  even pressing the '...' to move to the next group of pages works fine, sorting works fine too.  I"m using advanced binding where I get the Datasource on the OnNeedDatasource event but only on if (IsPostBack), I do not call DataBind() NeedDatasource event.  I only call DataBind() on the first PageLoad event because the grid loads with defaults the first time its rendered.  I've set the enableEventValidation="false" but this just hides the exception the grid will still not move to the next group of pages.  Using 2010 Q2 library.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Thanks

Pavlina
Telerik team
 answered on 04 Oct 2010
2 answers
375 views
Hi,

I am using Telerik RadControls for ASP.NET AJAX Q2 2010 in my current project.

On one of the web pages there are 2 RadListBoxes (i.e. RadListBox1 and RadListBox2).

When the user transfers any items from RadListBox1 to RadListBox2, the web page will display a RadWindow containing a legal waiver statement with 2 buttons, OK and Cancel. If the user clicks on Cancel button, the transfer operation will be cancelled.

In order to do this, I need to display a RadWindows in RadListBox's event handler RadListBox_Transferring.

I could not find any samples on how to do this.

Can you please show me how to do the following:
1. display the RadWindow in the code behind RadListBox_Transferring
2. detect if the Cancel button is clicked on the RadWindow so that I can cancel the transfer operation (i.e. set e.Cancel to true).

The code is as follows:
ASPX:
<form id="form1" runat="server">
<div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadListBox ID="RadListBox1" AllowDelete="false" AllowReorder="false"
            AllowTransfer="true" AutoPostBackOnTransfer="true" TransferMode="Move"
            TransferToID="RadListBox2" OnTransferring="RadListBox_Transferring"
            runat="server" />
        <telerik:RadListBox ID="RadListBox2" AutoPostBackOnTransfer="true"
            OnTransferring="RadListBox_Transferring" runat="server" />
    </telerik:RadAjaxPanel>
</div>
<div>
    <telerik:RadWindowManager ID="RadWindowManager1" ReloadOnShow="true"
        ShowContentDuringLoad="false" runat="server" />
</div>
</form>

C#:
public partial class ListBoxes : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.RadListBox1.Items.Add(new RadListBoxItem("Item1"));
            this.RadListBox1.Items.Add(new RadListBoxItem("Item2"));
        }
    }
  
    protected void RadListBox_Transferring(object sender, RadListBoxTransferringEventArgs e)
    {
        if (e.DestinationListBox.ID == "RadListBox2")
        {
            // Display RadWindow here
            // If user clicks the cancel button then do "e.Cancel = true;"
        }
    }
}

Regards,
Herman
Herman Gouw
Top achievements
Rank 2
 answered on 04 Oct 2010
4 answers
284 views
Hi,

On one of the web pages in my current project, there are 2 RadListBoxes (RadListBox1 on the left and RadListBox2 on the right).

When the user clicks the buttons to transfer a single/multiple/all items from RadListBox2 to RadListBox1, I want to display a confirmation box displaying the message "Are you sure you want to continue?" and 2 buttons (OK/Yes and Cancel/No).

If the user clicks OK/Yes, then the transfer will be done. Otherwise if the user clicks Cancel/No, the transfer will be cancelled.

The screen shot of the web page is given on http://img31.imageshack.us/img31/9424/listboxes.jpg

I have checked the Telerik samples and forums but could not find anything.

Can I display this confirmation by adding a JavaScript confirm function to the buttons' onclick event handler?

If this is the correct solution, can you show me how to add a JavaScript confirm function to these buttons' onclick event handler?

Otherwise, can you please show me the correct way to display the confirmation box?

Regards,
Herman
Herman Gouw
Top achievements
Rank 2
 answered on 04 Oct 2010
5 answers
81 views
Hi,
I have 2 splitters that on of them contains a sliding pane opens on the other splitter.
Its works well (opens on the content) under Explorer and Firefox 3.0+ but on the machines that will be needed to operate the system we have Slax machine with Firefox 2.5 and its showing the pane underneath the content.
Here is my code (sorry about the "****"):

<head runat="server">
    <title>****</title>
    <link href="css/***.css" rel="stylesheet" type="text/css" />
    <link href="1.css" rel="stylesheet" type="text/css" />
    <link href="2.css" rel="stylesheet" type="text/css" />
    <link href="css/GridView.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        div#UniquesSplitter
        {
            float: left;
        }
        div#RadSplitter1
        {
            float: left;
        }
         
    </style>
 
 
 
    <script type="text/javascript">
        function onClicking(sender, eventArgs) {
            var item = eventArgs.get_item();
            var itemText = item.get_text();
            var itemNavigate = item.get_navigateUrl();
            if (itemText != "Search") {
                eventArgs.set_cancel(true);
                if (itemNavigate != "#") {
                    if (itemNavigate.startsWith("(UpdUrl)")) {
                        itemNavigate = itemNavigate.substring(8);
                        var strArr = itemNavigate.split(',');

                    }
                    else {
                        window.open(itemNavigate, itemText, null, null);
                    }
                }
            }
        }
 
     
    </script>
 
</head>
<body class="bodyStyle">
    <form id="form1" runat="server">
    <input type="hidden" id="url" name="url" value="" />
    <telerik:RadScriptManager runat="server" EnablePartialRendering="true">
    </telerik:RadScriptManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="****" runat="server" ShowContentDuringLoad="True" Width="600px"
                Height="400px" Title="****" Behaviors="Default">
            </telerik:RadWindow>
            <telerik:RadWindow ID="****" runat="server" ShowContentDuringLoad="True"
                Width="600px" Height="400px" Modal="true" Behaviors="Close">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <table width="100%">
        <tr>
            <td>
                <telerik:RadMenu ID="TopMenu" runat="server" DataFieldID="ID" DataFieldParentID="ParentID"
                    DataNavigateUrlField="URL" OnClientItemClicking="onClicking" DataTextField="Name"
                    Skin="WebBlue">
                </telerik:RadMenu>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadSplitter ID="UniquesSplitter" runat="server" Height="1000px" ResizeWithBrowserWindow="true"
                    Orientation="Vertical">
                    <telerik:RadPane ID="EndPane" runat="server" Width="22" Scrolling="none">
                        <telerik:RadSlidingZone ID="Radslidingzone1" runat="server" Width="22" SlideDirection="Right">
                            <telerik:RadSlidingPane ID="Radslidingpane1" Title="My Results" BackColor="#dedede"
                                EnableDock="false" runat="server">
                                <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                            </telerik:RadSlidingPane>
                        </telerik:RadSlidingZone>
                    </telerik:RadPane>
                </telerik:RadSplitter>
                <telerik:RadSplitter ID="RadSplitter1" LiveResize="false" VisibleDuringInit="false"
                    ResizeWithBrowserWindow="true" ResizeMode="Proportional" Width="94%" Height="1000px"
                    Orientation="Horizontal" runat="server">
                    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Both" />
                    <telerik:RadPane ID="****" Height="9%" Width="100%" runat="server">
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                            <ContentTemplate>
                                <AutoDialer:Control ID="****" runat="server" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="TabsSplit" runat="server" CollapseMode="Both" />
                    <telerik:RadPane ID="TabStripPane" Height="89%" Width="100%" runat="server">
                    <div id="div" class="SetStyle">
                        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Align="Center" MultiPageID="RadMultiPage1"
                            ScrollButtonsPosition="Middle" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab runat="server" PageViewID="*****" Text="****">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" PageViewID="****" Text="*****">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="****">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
                            <telerik:RadPageView ID="*****" runat="server" Width="100%">
                                <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
                                    <ContentTemplate>
                                     
                                            <Messages:YourMessage ID="*****" runat="server" />
                                            <ContactDetails:ContactDetailsUserControl ID="****" runat="server" />
                                            <ContactDetails:ApplicantDetails ID="****" runat="server" />
                                            <ContactDetails:OrigUniqueDetails ID="****" runat="server" />
                                            <ContactDetails:LastTransaction ID="****" runat="server" />
                                            <ContactDetails:LeadDetails ID="****" runat="server" />
                                            <ContactDetails:LeadHistoryUserControl ID="****" runat="server" />
                                        
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="****" runat="server" Width="100%">
                                <PaymentsDetails:PaymentsHistory ID="****" runat="server" />
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                        </div>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
Tsvetie
Telerik team
 answered on 04 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?