Hi telerik
here is my scenario:
I have a textbox a submit button and two grids in one page
in textbox, users have to insert a name and in that two grids insert some rows
after user pushes submit button all grids rows and textbox's value must insert into database and two grids have to connect whit the textbox record's id;
actually I'm trying to do all these process by just one click
so is there any recommendation to do this?
Hi There,
I run into an issue that the loading panel is not showing with RadScheduler. I created a test page from the code of the telerik demo, it stills not showing the loading panel, just showing flashes between the postback (when changes the monthview to weekview etc). Please help. Thanks.
Following the the code of SchedulerTest.aspx, and SchedulerTest.aspx.cs
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SchedulerTest.aspx.cs" Inherits="SchedulerTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"true"
/>
<
div
>
<
telerik:RadScheduler
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadScheduler1"
DayStartTime
=
"08:00:00"
DayEndTime
=
"18:00:00"
OnAppointmentInsert
=
"RadScheduler1_AppointmentInsert"
OnAppointmentUpdate
=
"RadScheduler1_AppointmentUpdate"
OnAppointmentDelete
=
"RadScheduler1_AppointmentDelete"
DataKeyField
=
"ID"
DataSubjectField
=
"Subject"
DataStartField
=
"Start"
DataEndField
=
"End"
DataRecurrenceField
=
"RecurrenceRule"
DataRecurrenceParentKeyField
=
"RecurrenceParentId"
DataReminderField
=
"Reminder"
>
<
AdvancedForm
Modal
=
"true"
></
AdvancedForm
>
<
TimelineView
UserSelectable
=
"false"
></
TimelineView
>
<
TimeSlotContextMenuSettings
EnableDefault
=
"true"
></
TimeSlotContextMenuSettings
>
<
AppointmentContextMenuSettings
EnableDefault
=
"true"
></
AppointmentContextMenuSettings
>
<
Reminders
Enabled
=
"true"
></
Reminders
>
</
telerik:RadScheduler
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadScheduler1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadScheduler1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
>
</
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
>
</
telerik:RadAjaxLoadingPanel
>
</
div
>
</
form
>
</
body
>
</
html
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class SchedulerTest : System.Web.UI.Page
{
private const string AppointmentsKey = "Telerik.Web.Examples.Scheduler.BindToList.CS.Apts";
private List<
AppointmentInfo
> Appointments
{
get
{
List<
AppointmentInfo
> sessApts = Session[AppointmentsKey] as List<
AppointmentInfo
>;
if (sessApts == null)
{
sessApts = new List<
AppointmentInfo
>();
Session[AppointmentsKey] = sessApts;
}
return sessApts;
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (!IsPostBack)
{
Session.Remove(AppointmentsKey);
InitializeResources();
InitializeAppointments();
}
RadScheduler1.DataSource = Appointments;
}
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
{
Appointments.Add(new AppointmentInfo(e.Appointment));
}
protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
AppointmentInfo ai = FindById(e.ModifiedAppointment.ID);
RecurrenceRule rrule;
if (RecurrenceRule.TryParse(e.ModifiedAppointment.RecurrenceRule, out rrule))
{
rrule.Range.Start = e.ModifiedAppointment.Start;
rrule.Range.EventDuration = e.ModifiedAppointment.End - e.ModifiedAppointment.Start;
TimeSpan startTimeChange = e.ModifiedAppointment.Start - e.Appointment.Start;
for (int i = 0; i < rrule.Exceptions.Count; i++)
{
rrule.Exceptions[i] = rrule.Exceptions[i].Add(startTimeChange);
}
e.ModifiedAppointment.RecurrenceRule = rrule.ToString();
}
ai.CopyInfo(e.ModifiedAppointment);
}
protected void RadScheduler1_AppointmentDelete(object sender, SchedulerCancelEventArgs e)
{
Appointments.Remove(FindById(e.Appointment.ID));
}
private void InitializeResources()
{
ResourceType resType = new ResourceType("User");
resType.ForeignKeyField = "UserID";
RadScheduler1.ResourceTypes.Add(resType);
RadScheduler1.Resources.Add(new Resource("User", 1, "Alex"));
RadScheduler1.Resources.Add(new Resource("User", 2, "Bob"));
RadScheduler1.Resources.Add(new Resource("User", 3, "Charlie"));
}
private void InitializeAppointments()
{
DateTime start = DateTime.UtcNow.Date;
start = start.AddHours(6);
Appointments.Add(new AppointmentInfo("Take the car to the service", start, start.AddHours(1), string.Empty, null, new Reminder(30).ToString(), 1));
Appointments.Add(new AppointmentInfo("Meeting with Alex", start.AddHours(2), start.AddHours(3), string.Empty, null, string.Empty, 2));
start = start.AddDays(-1);
DateTime dayStart = RadScheduler1.UtcDayStart(start);
Appointments.Add(new AppointmentInfo("Bob's Birthday", dayStart, dayStart.AddDays(1), string.Empty, null, string.Empty, 1));
Appointments.Add(new AppointmentInfo("Call Charlie about the Project", start.AddHours(2), start.AddHours(3), string.Empty, null, string.Empty, 2));
start = start.AddDays(2);
Appointments.Add(new AppointmentInfo("Get the car from the service", start.AddHours(2), start.AddHours(3), string.Empty, null, string.Empty, 1));
}
private AppointmentInfo FindById(object ID)
{
foreach (AppointmentInfo ai in Appointments)
{
if (ai.ID.Equals(ID))
{
return ai;
}
}
return null;
}
}
class AppointmentInfo
{
private readonly string _id;
private string _subject;
private DateTime _start;
private DateTime _end;
private string _recurrenceRule;
private string _recurrenceParentId;
private string _reminder;
private int? _userID;
public string ID
{
get
{
return _id;
}
}
public string Subject
{
get
{
return _subject;
}
set
{
_subject = value;
}
}
public DateTime Start
{
get
{
return _start;
}
set
{
_start = value;
}
}
public DateTime End
{
get
{
return _end;
}
set
{
_end = value;
}
}
public string RecurrenceRule
{
get
{
return _recurrenceRule;
}
set
{
_recurrenceRule = value;
}
}
public string RecurrenceParentID
{
get
{
return _recurrenceParentId;
}
set
{
_recurrenceParentId = value;
}
}
public int? UserID
{
get
{
return _userID;
}
set
{
_userID = value;
}
}
public string Reminder
{
get
{
return _reminder;
}
set
{
_reminder = value;
}
}
private AppointmentInfo()
{
_id = Guid.NewGuid().ToString();
}
public AppointmentInfo(string subject, DateTime start, DateTime end,
string recurrenceRule, string recurrenceParentID, string reminder, int? userID)
: this()
{
_subject = subject;
_start = start;
_end = end;
_recurrenceRule = recurrenceRule;
_recurrenceParentId = recurrenceParentID;
_reminder = reminder;
_userID = userID;
}
public AppointmentInfo(Appointment source)
: this()
{
CopyInfo(source);
}
public void CopyInfo(Appointment source)
{
Subject = source.Subject;
Start = source.Start;
End = source.End;
RecurrenceRule = source.RecurrenceRule;
if (source.RecurrenceParentID != null)
{
RecurrenceParentID = source.RecurrenceParentID.ToString();
}
if (!String.IsNullOrEmpty(Reminder))
{
Reminder = source.Reminders[0].ToString();
}
Resource user = source.Resources.GetResourceByType("User");
if (user != null)
{
UserID = (int?)user.Key;
}
else
{
UserID = null;
}
}
}
I have some custom filtering on a grid I'm doingwith comboboxes and AJAX. Each combobox is linked to the grid the the rad ajaxmanager like so:
<telerik:AjaxSetting AjaxControlID="ddlXXX">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grid1" LoadingPanelID="RadAjaxLoadingPanel1"/>
</UpdatedControls>
</telerik:AjaxSetting>
I'm calling a GetDate() method that returns a data table to bind the grid to the data source in the page_prerender event. All works well, except for when I uncheck a checkbox in the combobox. If I check a checkbox it causes the post back and the GetData() method is called, but if I uncheck a checkbox the GetData() method is never called and the filtering isnt refreshed. Am I missing something in the Page LifeCycle? Why wouldn't the Page_PreRender event be called when I uncheck a checkbox inside a combobox? Should the DataBind be called at another point in the page's lifecycle?
Hi all,
In RadGrid when the Virtualization feature is enabled and ocurres a postback the Grid scrolls to top even if the SaveScrollPosition property is set to True. This behavior can be reproduced in Demo page: http://demos.telerik.com/aspnet-ajax/grid/examples/performance/virtualization/defaultcs.aspx following these steps:
This is a bug? There's any workaround to solve this issue?
Regards!
Hi,
When using a ClientDataSource to populate a couple of drop downs I have a routine in the first one that on selected item changing it triggers the second one to update.
The issue I have is that if you change the first one again it doesn't update the second drop down, tracing it, it seems that it doesn't actually do anything with the clientdatasource even though the itemsrequested event fires once it is done (doing nothing!).
I am using the following code to trigger the update on the second combo.
Any suggestions? It is worth noting again that this works the first time, it is on the second update that it doesn't change the drop down.
Regards
Jon
child.clearItems();
child.set_text(
'Loading'
);
child.requestItems(
null
,
false
);
<
style
type
=
"text/css"
>
.RadScheduler_Sitefinity .rsMonthView .rsTodayCell
{
background: orange !important ;
}
/* formats each app item container in Month view */
.RadScheduler_Sitefinity .rsMonthView div.rsWrap
{
height: 20px !important;
padding: 1px 0 1px 0 !important;
}
/* formats the actual label that appears in each app item container in Month view */
.RadScheduler_Sitefinity .rsMonthView div.rsApt
{
height: 20px !important;
overflow: hidden;
}
</
style
>
<
telerik:RadScheduler
CustomAttributeNames
=
"resourceLabelColour,eventID"
ID
=
"RadScheduler1"
runat
=
"server"
OnClientAppointmentClick
=
"viewAppInfo"
DataEndField
=
"appEndTime"
DataKeyField
=
"appID"
DataSourceID
=
"SqlDataSource1"
DataStartField
=
"appStartTime"
DataSubjectField
=
"appSubject"
height
=
"1000px"
Skin
=
"Sitefinity"
>
</
telerik:RadScheduler
>
Me.RadScheduler1.SelectedDate = DateTime.Now
Me.panelFilter.Width = Unit.Percentage(100)
Me.RadScheduler1.SelectedView = SchedulerViewType.MonthView
Me.RadScheduler1.MonthView.VisibleAppointmentsPerDay = 6
'Me.RadScheduler1.MonthView.MinimumRowHeight = 6
'Me.RadScheduler1.MonthView.AdaptiveRowHeight
Me.RadScheduler1.FirstDayOfWeek = DayOfWeek.Monday
Me.RadScheduler1.LastDayOfWeek = DayOfWeek.Sunday
Me.RadScheduler1.TimelineView.UserSelectable = False
Me.RadScheduler1.ReadOnly = False
Me.RadScheduler1.AllowEdit = False
Me.RadScheduler1.AllowDelete = False
When i right click on the table inside the editor contetn area and select table properties/cell properties. i receive this error
Table Wizard Unknown server tag 'dc:TableLayouts'.
see the attachment....
Radscheduler not displaying correctly on first time run.
I didn't give any height or width to the scheduler.
If again I reload or postback the page, It would be perfect.
How do I Solve it...