or
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editableItem)
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" ValidateRequest="false"
CodeBehind="AppSettings.aspx.vb" Inherits="AdminTools.AppSettings" MaintainScrollPositionOnPostback="true" %>
<%@ MasterType VirtualPath="~/Site.Master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"ContentHeader"
runat
=
"server"
>
<
style
type
=
"text/css"
>
.div
{
clear: both;
padding: 5px;
}
.col1
{
float: left;
width: 75%;
background-color: #E1E1E1;
min-height: 700px;
}
.col2
{
float: left;
width: 20%;
background-color: #EFEFEF;
min-height: 700px;
padding-left: 10px;
}
.row
{
clear: both;
padding: 5px;
}
.cell
{
float: left;
min-width: 200px;
padding-right: 15px;
}
</
style
>
<
script
type
=
"text/javascript"
>
function ShowNewForm(element) {
var objElement = $get(element);
if (objElement.style.visibility == "hidden") {
objElement.style.visibility = "visible";
objElement.style.display = "";
}
else {
objElement.style.visibility = "hidden";
objElement.style.display = "none";
}
}
</
script
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
div
id
=
"PageMain"
>
<
div
style
=
"margin: 50px;"
>
<
div
id
=
"Applications"
class
=
"div"
>
<
div
class
=
"div"
>
Application:</
div
>
<
div
>
<
telerik:RadComboBox
ID
=
"cboApplication"
runat
=
"server"
AutoPostBack
=
"true"
Width
=
"200px"
>
</
telerik:RadComboBox
>
</
div
>
</
div
>
<
div
id
=
"Settings"
runat
=
"server"
class
=
"div"
>
<
telerik:RadGrid
ID
=
"dgvAppSettings"
runat
=
"server"
skin
=
"Outlook"
AllowPaging
=
"true"
Pagesize
=
"20"
AllowSorting
=
"true"
AutoGenerateColumns
=
"false"
OnNeedDataSource
=
"dgvAppSettings_OnNeedDataSource"
OnItemCommand
=
"dgvAppSettings_ItemCommand"
ShowStatusBar
=
"true"
>
<
ClientSettings
EnableAlternatingItems
=
"true"
EnableRowHoverStyle
=
"true"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
CommandItemDisplay
=
"Bottom"
AutoGenerateColumns
=
"false"
DataKeyNames
=
"ID"
>
<
Columns
>
<
telerik:GridEditCommandColumn
AutoPostBackOnFilter
=
"true"
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
SortExpression
=
"ID"
UniqueName
=
"ID"
Visible
=
"false"
MaxLength
=
"5"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AppID"
HeaderText
=
"AppID"
SortExpression
=
"AppID"
UniqueName
=
"AppID"
Visible
=
"false"
MaxLength
=
"5"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SettingType"
HeaderText
=
"Setting Type"
UniqueName
=
"SettingType"
Visible
=
"true"
MaxLength
=
"5"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SettingName"
HeaderText
=
"Setting Name"
UniqueName
=
"SettingName"
Visible
=
"true"
MaxLength
=
"50"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SettingValue"
HeaderText
=
"Setting Value"
UniqueName
=
"SettingValue"
Visible
=
"true"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
/>
</
div
>
</
div
>
</
div
>
</
asp:Content
>
Protected
Sub
dgvAppSettings_UpdateCommand(sender
As
Object
, e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
dgvAppSettings.UpdateCommand
Dim
editableItem = (
DirectCast
(e.Item, GridEditableItem))
Dim
SettingsTable
As
DataTable =
Me
.GridSource
Dim
changedRows
As
DataRow() = SettingsTable.
Select
(
"ID = "
+ editableItem.OwnerTableView.DataKeyValues(editableItem.ItemIndex)(
"ID"
).ToString())
If
changedRows.Length <> 1
Then
e.Canceled =
True
Return
End
If
Dim
newValues
As
New
Hashtable()
' ***
' It get past the "Dim of newValues..." just fine... however, on the next line it give me the error...
' ***
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editableItem)
changedRows(0).BeginEdit()
Try
For
Each
entry
As
DictionaryEntry
In
newValues
changedRows(0)(
DirectCast
(entry.Key,
String
)) = entry.Value
Next
changedRows(0).EndEdit()
Catch
ex
As
Exception
changedRows(0).CancelEdit()
e.Canceled =
True
End
Try
Label1.Text +=
" Table to be updated: "
+ e.Item.OwnerTableView.DataMember +
"<br>"
End
Sub
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) { Appointments.Add(new AppointmentInfo(e.Appointment)); } Can I do the above process in a buttonclick event where I can do all the calculations,insert/update the database and bind the scheduler? Also,If I am customizing the popup window/Insert form,do I need to do as in http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx in order to have the recurrence reminder or should I use a raddock for the same ?
<
telerik:GridDropDownColumn
ColumnEditorID
=
"GridDropDownColumnEditor1"
DataField
=
"Lokacija"
DataSourceID
=
"SqlDataSourceLokacija"
DataType
=
"System.Int64"
HeaderText
=
"Lokacija"
ListTextField
=
"NazivLokacije"
ListValueField
=
"idLokacije"
UniqueName
=
"ColumnLokacija"
>
<
FilterTemplate
>
<
telerik:RadComboBox
ID
=
"ColumnLokacija"
runat
=
"server"
AppendDataBoundItems
=
"true"
DataSourceID
=
"SqlDataSourceLokacija"
DataTextField
=
"NazivLokacije"
DataValueField
=
"idLokacije"
Height
=
"200px"
OnClientSelectedIndexChanged
=
"TitleIndexChanged"
SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("ColumnLokacija").CurrentFilterValue%>'>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"All"
/>
</
Items
>
</
telerik:RadComboBox
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function TitleIndexChanged(sender, args) {
var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>");
tableView.filter("ColumnLokacija", args.get_item().get_value(), "EqualTo"); }
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridDropDownColumn
>