protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.InitInsertCommandName)
{
GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");
editColumn.Visible = false;
GridEditableItem editedItem = e.Item as GridEditableItem;
e.Canceled = true;
//Prepare an IDictionary with the predefined values
System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();
//set initial checked state for the checkbox on init insert
newValues["active"] = true;
//Insert the item and rebind
e.Item.OwnerTableView.InsertItem(newValues);
}
else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
{
e.Canceled = true;
}
else
{
GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");
if (!editColumn.Visible)
editColumn.Visible = true;
}
protected void ObjectDataSource1_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
{
e.InputParameters["active"] = ??????
}
Somehow when I tried to save the value of checkbox after click in edit mode or insert mode. It won't take that value. Please help.
<
telerik:RadButton
ID
=
"buttonProcessing"
runat
=
"server"
ButtonType
=
"LinkButton"
Text
=
"Modify"
SingleClick
=
"true"
NavigateUrl
=
'the web address goes here'
SingleClickText
=
"Please wait..."
/>
.RadSplitter {
border-spacing
:
0
;
}
.rsPane,
.rspPaneHorizontal {
padding
:
0
;
}
Sys.Application.add_load(
function
() {
var
$ = $telerik.$;
$(
".rsHTML5ValidationFixer"
).removeClass(
"rsHTML5ValidationFixer"
);
});
<
telerik:RadMenu
id
=
"menuEmp"
ClientIDMode
=
"Static"
runat
=
"server"
flow
=
"Vertical"
OnClientItemClicked
=
"MenuOpenWindow"
Width
=
"100%"
BackColor
=
"#37495D"
>
<
Items
>
<
telerik:RadMenuItem
ImageUrl
=
"../Images/button1.png"
Value
=
"EmpProj"
/>
</
Items
>
</
telerik:RadMenu
>
<
telerik:RadWindow
id
=
"winEmpProj"
runat
=
"server"
Top
=
"0"
Left
=
"0"
Style
=
"z-index: 8000"
EnableEmbeddedSkins
=
"false"
OffsetElementID
=
"divEmpHeader"
ShowContentDuringLoad
=
"false"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"false"
AutoSize
=
"true"
>
<
ContentTemplate
>
<
div
id
=
"divProjListList"
runat
=
"server"
style
=
"width: 400px;"
>
<
div
>Projects</
div
>
<
div
style
=
"width: 400px"
>
<
telerik:RadGrid
ID
=
"grdEmp"
runat
=
"server"
AutoGenerateColumns
=
"False"
Skin
=
""
EnableLinqExpressions
=
"False"
CellSpacing
=
"0"
EnableViewState
=
"False"
>
<
ClientSettings
Selecting-AllowRowSelect
=
"false"
EnablePostBackOnRowClick
=
"true"
/>
<
MasterTableView
DataKeyNames
=
"KeyColumn"
ShowHeader
=
"true"
HeaderStyle-HorizontalAlign
=
"Center"
EnableViewState
=
"false"
>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"EmpNo"
HeaderText
=
"EmpNo"
ItemStyle-HorizontalAlign
=
"Left"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"btnEmpNo"
runat
=
"server"
OnClick
=
"LoadEmp"
><%# DataBinder.Eval(Container.DataItem, "EmpNo")%></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Department"
/>
<
telerik:GridBoundColumn
DataField
=
"Project"
/>
<
telerik:GridBoundColumn
DataField
=
"Supervisor"
/>
</
telerik:GridBoundColumn
>
</
Columns
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
</
div
>
</
div
>
</
ContentTemplate
>
</
telerik:RadWindow
>
<telerik:RadScriptBlock ID=
"RadScriptBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
function MenuOpenWindow(windowTitle) {
var oWindow;
var offsetElementBounds;
var menu = $find(
"<%=menu.ClientID%>"
);
var menuItem = menu.findItemByValue(windowTitle).get_element();
//Closes the last window opened
if (lastOpenedWindow) {
lastOpenedWindow.close();
lastOpenedWindow = null;
}
if (windowTitle ==
"EmpProj"
) {
if (lastWindowTitle !=
"EmpProj"
) {
oWindow = $find(
"<%=winEmpProj.ClientID%>"
);
oWindow.show();
if (oWindow.get_offsetElementID()) {
offsetElementBounds = $telerik.getBounds($get(oWindow.get_offsetElementID()));
var x = offsetElementBounds.x + (menuItem.offsetWidth / 3);
var y = menuItem.offsetTop + offsetElementBounds.y - (menuItem.offsetHeight / 3);
oWindow.moveTo(x, y);
}
lastOpenedWindow = oWindow;
lastWindowTitle =
"EmpProj"
;
return false;
} else {
lastWindowTitle = null;
}
}
}
</script>
</telerik:RadScriptBlock>
Private
Sub
menuEmp_ItemClick(sender
As
Object
, e
As
Telerik.Web.UI.RadMenuEventArgs)
Handles
menuEmp.ItemClick
Select
Case
e.Item.Value
Case
"Endorsed"
grdEndorsed.DataSource =
Nothing
grdEndorsed.Rebind()
End
Select
Dim
scriptstring
As
String
=
"function f(){{MenuOpenWindow('"
& e.Item.Value &
"');;Sys.Application.remove_load(f);}};Sys.Application.add_load(f);"
ScriptManager.RegisterStartupScript(
Me
,
Me
.[
GetType
](),
"showWindow"
, scriptstring,
True
)
End
Sub
Private
Function
LoadEmp()
'Stuff done
If
{stuff true}
Then
'Do stuff
Else
Dim
winManger
As
RadWindowManager = Master.FindControl(
"RadWindowManager1"
)
winManger.RadAlert(
"Something's Wrong"
, 50, 100,
"Project"
,
"message"
)
Exit
Sub
End
If
End
Function
<telerik:RadScriptBlock ID=
"RadScriptBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
//Global Variables
var
lastOpenedWindow;
var
lastWindowTitle;
var
alertWindowUp;
function
message(args) {
//This is here to give RadWindow serverside a place to go.
if
(lastWindowTitle ==
"EmpProj"
&& args ==
true
) {
alertWindowUp =
true
;
}
}
function
pageLoad() {
$addHandler(document,
"click"
, onClickHandler);
}
function
onClickHandler(e) {
var
targedNodeName = e.target;
if
(lastOpenedWindow) {
// If the RadWindow is clicked then do nothing ;
if
($telerik.isMouseOverElementEx(lastOpenedWindow.get_popupElement(), e))
return
;
lastOpenedWindow.close();
lastOpenedWindow =
null
;
lastWindowTitle =
null
;
if
(alertWindowUp ==
true
) {
lastWindowTitle =
null
;
MenuOpenWindow(
"EmpProj"
);
alertWindowUp =
false
;
}
}
}
</script>
</telerik:RadScriptBlock>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
Style
=
"z-index: 8000"
/>
Hello,
I am adding below tag <ExportSettings
in the <telerik:RadScheduler runat="server" ID="RadScheduler1" .........> Tag
<ExportSettings OpenInNewWindow="true" FileName="SchedulerExport">
<Pdf PageTitle="Schedule" Author="Telerik" Creator="Telerik" Title="Schedule" />
</ExportSettings>
there is button to export pdf:
protected void btnExportPdf_Click(object sender, EventArgs e)
{
RadScheduler1.ExportToPdf();
}
but the problem is no pdf open to download. It's resize the radScheduler control in small size when i click in Export button and no download popup page.
I see in demo page path:http://demos.telerik.com/aspnet-ajax/scheduler/examples/pdfexport/defaultcs.aspx.
How is the problem I can't understand.
Please help me as soon as possible.
Thanks
Jiten Mutum