Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
Hi

I am using Radscheduler and an underlying data base to manage site visits.

I have set my datasource as followed:
On insert there is a line created in the table (with auto ID) but no value for the other fields.
Also, when I try to move an appointment, it goes back where is was before.
So it seems that the fields are not passing to the database for some reason
Thanks for your help
Regards

<asp:SqlDataSource ID="SchedulerDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:TEST_DS%>"

 

ProviderName="System.Data.SqlClient"

 

SelectCommand="SELECT [SiteVisitID], [SiteVisitStart], [SiteVisitEnd], [SiteVisitSubject], [SiteVisitDue], [SiteVisitPriority] FROM [tbl_SiteVisit] WHERE ([SiteVisitStart] IS NOT NULL) AND ([SiteVisitEnd] IS NOT NULL)"

 

InsertCommand="INSERT INTO [tbl_SiteVisit] ([SiteVisitSubject], [SiteVisitStart], [SiteVisitEnd]) VALUES (@Subject, @Start, @End)"

 

UpdateCommand="UPDATE [tbl_SiteVisit] SET [SiteVisitStart] = @Start, [SiteVisitEnd] = @End, [SiteVisitSubject] = @Subject WHERE SiteVisitID = @ID"

 

DeleteCommand="DELETE FROM [tbl_SiteVisit] WHERE [SiteVisitID] = @ID">

 

<insertparameters>

 

<asp:Parameter Name="Subject" Type="String" />

 

<asp:Parameter Name="Start" Type="DateTime" />

 

<asp:Parameter Name="End" Type="DateTime" />

 

</insertparameters>

 

<updateparameters>

 

<asp:Parameter Name="Subject" Type="String" />

 

<asp:Parameter Name="Start" Type="DateTime" />

 

<asp:Parameter Name="End" Type="DateTime" />

 

<asp:Parameter Name="ID" Type="Int32" />

 

</updateparameters>

 

<deleteparameters>

 

<asp:Parameter Name="ID" Type="Int32" />

 

</deleteparameters>

 

</asp:SqlDataSource>


Peter
Telerik team
 answered on 04 Oct 2010
3 answers
168 views
I found Javascript from the search site function which enables me to check the number of characters when I paste.
Unfotunately, it doesn't work!

The javascript is below, and the ClientExecutedCommand function is fired on "OnClientCommandExecuted":
<script type="text/javascript">  
 function CalculateLength(editor, value) {  
            var textLength = editor.get_text().length;  
            var clipboardLength = value.length;  
            textLength += clipboardLength;  
            return textLength;  
        }  
 
 
        function ClientExecuteCommand(editor, args) {  
            var commandName = args.get_commandName();  
            var value = args.get_value();  
            if (commandName == "PasteFromWord"  
            || commandName == "PasteFromWordNoFontsNoSizes"  
            || commandName == "PastePlainText"  
            || commandName == "PasteAsHtml"  
            || commandName == "Paste") {  
                var textLength = CalculateLength(editor, value);  
                if (textLength >= 10) {  
                    alert("Max char. reached");  
                    args.set_cancel(true);  
 
                }  
            }  
        }     
</script> 

The HTML:
                    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientCommandExecuted="ClientExecuteCommand">  
                        <Content> 
                        </Content> 
                    </telerik:RadEditor> 

The problem is that line 12 args.get_value() of the Javascript returns null although I have contents in my clipboard and I can see that when I paste in to Notepad there is something there.

Does anyone have any ideas?

Thanks
R
Rumen
Telerik team
 answered on 04 Oct 2010
1 answer
314 views

Hi,


We have following query on Rad editor

 

When data is get copied from notepad into telerik editor, line break by “br” (<br />) tag get added. Also new line char. (\r\n) present in editor content.

Is there any way to keep only “br” or new line char. (\r\n), when data is being copied to editor design mode from notepad?

  

Rumen
Telerik team
 answered on 04 Oct 2010
2 answers
106 views
I noticed the following lines in the release notes for 2010.2.929:

Fixed: The dropdown size is incorrect the first time the dropdown opens if its height exceeds the window's visible height and the document has 'overflow: hidden'

Fixed: The dropdown size is incorrect in IE the first time if there are items with long text with spaces

However, we're now seeing a similar problem (the dropdown size is very small the first time you open it; it's correctly sized the second and subsequent times) in our application after upgrading to 2010.2.929; we weren't seeing it before (on the Q2 SP1 release). It appears to occur on a RadComboBox that has items with long text with spaces; the dropdown size isn't longer than the window size.

Is there a workaround/known issue?

Eric Means
Top achievements
Rank 1
 answered on 04 Oct 2010
2 answers
150 views
I have a RadMenu which is successfully binding to my IQueryable collection.  However, I have several items that I'd like to ALWAYS appear on the menu, which are not in the datasource.  What is the best way to accomplish this?  Specifically, some of the items will require custom ItemTemplates.  I tried an approach like this without success.  When I would call DataBind(), it seems the control would ignore the hard coded items I'd added and only apply the databound items.

     <telerik:RadMenuItem runat="server"
             <Items><telerik:RadMenuItem>        
                        <ItemTemplate>
                             <ContentTemplate>
                                   My code here....
                                        </ContentTemplate>
                                 <
ItemTemplate>
                   
</Items>
      </telerik:RadMenuItem>
Cori
Top achievements
Rank 2
 answered on 04 Oct 2010
4 answers
161 views
Dear forum,
i have a tabstrip with one multipage and severall pageviews.
Just in one (of up to 5) pageviews i have input controls and a submit button.
This input controls should be validated only if this button is pressed,
but i don't want validating, when the user just want to switch to another tab/pageview.
Is this possible.
Currently i can just switch tabs when all date in the input controls are correct (in case causevalidate = true for the tabstrip) because of validating.
But no validating is done at all when causevalidate = true for the button and false for the tabstrip.
Any suggestions how to realize my szenario ?
Kind regards
Martin
Martin Gartmann
Top achievements
Rank 2
 answered on 04 Oct 2010
2 answers
282 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
94 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
91 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
458 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?