or
protected
void
Page_Load(
object
sender, EventArgs e)
{
DrAppointment app =
new
DrAppointment();
RadScheduler1.DataSource = app.GetAll();
RadScheduler1.DataBind();
RadScheduler1.AppointmentInsert +=
new
Telerik.Web.UI.AppointmentInsertEventHandler(RadScheduler1_AppointmentInsert);
RadScheduler1.AppointmentUpdate +=
new
Telerik.Web.UI.AppointmentUpdateEventHandler(RadScheduler1_AppointmentUpdate);
RadScheduler1.AppointmentDelete +=
new
Telerik.Web.UI.AppointmentDeleteEventHandler(RadScheduler1_AppointmentDelete);
RadScheduler1.FormCreated +=
new
Telerik.Web.UI.SchedulerFormCreatedEventHandler(RadScheduler1_FormCreated);
}
void
RadScheduler1_AppointmentInsert(
object
sender, Telerik.Web.UI.SchedulerCancelEventArgs e)
{
if
(ExceedsLimit(e.Appointment))
{
lblError.Text =
"Another appointment exists in this time slot."
;
e.Cancel =
true
;
}
else
{
DrAppointment app =
new
DrAppointment(e.Appointment);
app.Save();
}
}
ScriptManager.RegisterStartupScript(Page,
GetType(Page), "RadAlertScript", "Sys.Application.add_load(function(){var t=radopen('test.aspx?', null);t.setSize(1000,700);t.Center();});", True)
Thank you,
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
Runat
=
"Server"
>
</
asp:Content
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Skin
=
"Windows7"
AllowCustomPaging
=
"True"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
AutoGenerateHierarchy
=
"True"
>
<
ExportSettings
ExportOnlyData
=
"True"
FileName
=
"Export"
>
<
Excel
Format
=
"ExcelML"
/>
</
ExportSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ManufacturerName"
DataSourceID
=
"SqlDataSource1"
Frame
=
"Void"
GridLines
=
"None"
>
<
CommandItemSettings
ShowExportToCsvButton
=
"True"
ShowExportToExcelButton
=
"True"
ShowExportToWordButton
=
"True"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ManufacturerName"
HeaderText
=
"Manufacturer Name"
SortExpression
=
"ManufacturerName"
UniqueName
=
"ManufacturerName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBinaryImageColumn
AllowFiltering
=
"False"
AllowSorting
=
"False"
DataField
=
"ManufacturerLogo"
DefaultInsertValue
=
""
HeaderText
=
"Logo"
ImageAlign
=
"Middle"
ImageHeight
=
"100px"
ImageWidth
=
"100px"
ResizeMode
=
"Fit"
UniqueName
=
"column"
ConvertEmptyStringToNull
=
"False"
>
</
telerik:GridBinaryImageColumn
>
<
telerik:GridEditCommandColumn
>
</
telerik:GridEditCommandColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
></
EditColumn
>
</
EditFormSettings
>
<
CommandItemStyle
Height
=
"50px"
Width
=
"50px"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:dbConnectionString %>"
SelectCommand="SELECT * FROM [tbl_manufacturers]"
UpdateCommand="UPDATE tbl_manufacturers SET ManufacturerName = @ManufacturerName, ManufacturerLogo = @ManufacturerLogo WHERE (ManufacturerName = @ManufacturerName)"
<
UpdateParameters
>
<
asp:Parameter
Name
=
"ManufacturerName"
/>
<
asp:Parameter
Name
=
"ManufacturerLogo"
DbType
=
"Binary"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
Runat
=
"server"
>
</
telerik:RadScriptManager
>
var node = $find(e.get_id());
node = node.get_element();