Line 7190: try
(B=a.parseJSON(z.body.innerHTML);
Line 7191: }
catch
(A){j(y);
protected
void
dd_RptDate_SelectedIndexChanged(
object
sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
if
(e.Value ==
"DAILY"
)
Session[
"s_datePickers"
] =
"true"
;
else
Session[
"s_datePickers"
] =
"false"
;
}
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Skin
=
"Office2007"
AllowPaging
=
"false"
Width
=
"100%"
EnableLinqExpressions
=
"true"
AllowCustomPaging
=
"false"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
AllowSorting
=
"true"
AllowFilteringByColumn
=
"false"
AlternatingItemStyle-BackColor
=
"#eeeeee"
ShowGroupPanel
=
"False"
ShowStatusBar
=
"True"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
>
<
AlternatingItemStyle
BackColor
=
"#EEEEEE"
></
AlternatingItemStyle
>
<
MasterTableView
Width
=
"100%"
DataKeyNames
=
"DocumentLogID"
PagerStyle-Mode
=
"NextPrevNumericAndAdvanced"
ClientDataKeyNames
=
"DocumentLogID"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
""
HeaderText
=
" "
FieldName
=
"AccessPerson"
HeaderValueSeparator
=
""
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"AccessPerson"
HeaderText
=
"Access Person"
SortOrder
=
"Ascending"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"PrintDoc"
HeaderText
=
"Print"
>
<
HeaderTemplate
>
<
asp:CheckBox
ID
=
"headerChkbox"
OnCheckedChanged
=
"ToggleSelectedState"
AutoPostBack
=
"True"
runat
=
"server"
></
asp:CheckBox
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"PrintCheckBox"
runat
=
"server"
OnCheckedChanged
=
"ToggleRowSelection"
AutoPostBack
=
"true"
Visible
=
"true"
></
asp:CheckBox
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"DocumentLogID"
Visible
=
"false"
UniqueName
=
"DocumentLogID"
/>
<
telerik:GridBoundColumn
DataField
=
"ClientID"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"AccessPersonID"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
DataField
=
"ReportID"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"ReportName"
DataField
=
"ReportName"
HeaderText
=
"Report Name"
/>
<
telerik:GridBoundColumn
SortExpression
=
"StatusDescription"
DataField
=
"StatusDescription"
HeaderText
=
"Status"
/>
<
telerik:GridBoundColumn
DataField
=
"DocumentStatusID"
UniqueName
=
"DocumentStatusID"
Groupable
=
"False"
Visible
=
"False"
/>
<
telerik:GridBoundColumn
SortExpression
=
"SentBy"
DataField
=
"SentBy"
HeaderText
=
"Sent By"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"DateSent"
DataField
=
"DateSent"
HeaderText
=
"Date Sent"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MM/dd/yyyy}"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"DueDate"
DataField
=
"DueDate"
HeaderText
=
"Date Due"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MM/dd/yyyy}"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"PrintReason1"
DataField
=
"PrintReason1"
HeaderText
=
"Print Reason"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"StartDate"
DataField
=
"StartDate"
HeaderText
=
"Start Due"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MM/dd/yyyy}"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"EndDate"
DataField
=
"EndDate"
HeaderText
=
"End Due"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:MM/dd/yyyy}"
AllowFiltering
=
"false"
/>
<
telerik:GridBoundColumn
SortExpression
=
"Version"
DataField
=
"Version"
HeaderText
=
"Version"
AllowFiltering
=
"false"
/>
</
Columns
>
<
EditFormSettings
UserControlName
=
"Controls/PrintDocDetails.ascx"
EditFormType
=
"WebUserControl"
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
>
<
ItemStyle
Width
=
"100%"
/>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
FilterMenu
Skin
=
"Office2007"
EnableTheming
=
"True"
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
></
CollapseAnimation
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
table
class
=
"rgMasterTable rgClipCells"
id
=
"ctl00_dialogPlaceholder_addRecipientsDialog_allRecipientsGrid_ctl00"
style
=
"width: 100%; overflow: hidden; table-layout: fixed; text-overflow: ellipsis; empty-cells: show;"
border
=
"0"
control
=
"[object Object]"
>
<
table
class
=
"rgMasterTable rgClipCells"
id
=
"ctl00_dialogPlaceholder_addRecipientsDialog_allRecipientsGrid_ctl00"
style
=
"width: auto; overflow: hidden; table-layout: fixed; text-overflow: ellipsis; empty-cells: show;"
border
=
"0"
control
=
"[object Object]"
><
br
>
<
telerik:RadGrid
ID
=
"allRecipientsGrid"
Skin
=
"Default"
runat
=
"server"
EnableAJAX
=
"True"
EnableAJAXLoadingTemplate
=
"True"
ClientSettings-AllowKeyboardNavigation
=
false
<br> OnNeedDataSource="allRecipientsGrid_NeedDataSource" Width="98%" AllowMultiRowSelection="false"<
br
> Height="281px" UseEmbeddedScripts="false" RadControlsDir="~/RadControls">
<
br
>
<
PagerStyle
Mode
=
"NextPrev"
/>
<
br
>
<
HeaderStyle
Font-Bold
=
"true"
/>
<
br
>
<
MasterTableView
AutoGenerateColumns
=
"false"
AllowPaging
=
"false"
AllowCustomPaging
=
"false"
>
<
br
>
<
RowIndicatorColumn
>
<
br
>
</
RowIndicatorColumn
>
<
br
>
<
Columns
>
<
br
>
<
telerik:GridTemplateColumn
>
<
br
>
<
HeaderStyle
Width
=
"68%"
/>
<
br
>
<
ItemStyle
Width
=
"68%"
/>
<
br
>
<
ItemTemplate
>
<
br
>
<
span
class
=
"recipientObjectTag"
style
=
"display: none; visibility: hidden;"
><
br
>
<%# ((MailRecipient)Container.DataItem).ToJSON() %><
br
>
</
span
>
<
label
>
<
input
class
=
"chkSelectedUser"
type
=
"checkbox"
name
=
"selecteduser"
value
=
""
onclick
=
"this.value=this.parentNode.previousSibling.innerHTML;"
/><
br
>
<%# ((MailRecipient)Container.DataItem).FullNameShort %><
br
>
</
label
><
br
>
</
ItemTemplate
><
br
>
</
telerik:GridTemplateColumn
><
br
>
<
telerik:GridTemplateColumn
><
br
>
<
HeaderStyle
Width
=
"32%"
/><
br
>
<
ItemStyle
Width
=
"32%"
/><
br
>
<
ItemTemplate
><
br
>
<%# ((MailRecipient)Container.DataItem).GetTypeName(this.IsCourseContext) %><
br
>
</
ItemTemplate
><
br
>
</
telerik:GridTemplateColumn
><
br
>
</
Columns
><
br
>
</
MasterTableView
><
br
>
<
ClientSettings
><
br
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"True"
/><
br
>
<
Selecting
AllowRowSelect
=
"true"
/><
br
>
<
ClientEvents
OnGridCreated
=
"recipientsGridCreated"
OnDataBound
=
"recipientsGridRequestEnd"
/><
br
>
</
ClientSettings
><
br
>
</
telerik:RadGrid
>
<telerik:RadScriptBlock ID=
"RadScriptBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
function
checkFileExists() {
var
count = 0;
var
upld = $find(
'<%= RadUpload1.ClientID %>'
);
var
input = $find(
'<%= RadUpload1.ClientID %>'
).getFileInputs();
var
fileName = input[0].value.toLowerCase();
var
allowOverWriteFile =
true
;
//To check whether the selected file is with mp4 extension or not
if
(upld.isExtensionValid(fileName) ==
false
) {
alert(
"You are allowed to upload only MP4 files. Kindly select the MP4 video and upload again."
);
return
false
;
}
//To confirm overwrite
count = document.getElementById(
'<%= txtUrl.ClientID %>'
).options.length;
for
(
var
i = 0; i < count; i++) {
if
(fileName == document.getElementById(
'<%= txtUrl.ClientID %>'
).options[i].value.toLowerCase()) {
allowOverWriteFile = confirm(
"This file is already exists. Are you sure want to overwrite it?"
);
return
allowOverWriteFile;
}
}
return
true
;
}
</script>
</telerik:RadScriptBlock>
<telerik:RadProgressManager ID=
"RadProgressManager1"
runat=
"server"
Width=
"245px"
/>
<telerik:RadProgressArea ID=
"RadProgressArea1"
runat=
"server"
ProgressIndicators=
"TotalProgressBar,CurrentFileName,RequestSize,TransferSpeed"
Skin=
"Default"
Width=
"245px"
DisplayCancelButton=
"true"
>
</telerik:RadProgressArea>
<telerik:RadUpload ID=
"RadUpload1"
runat=
"server"
OverwriteExistingFiles=
"true"
ControlObjectsVisibility=
"None"
InitialFileInputsCount=
"1"
AllowedFileExtensions=
".mp4"
Width=
"100px"
allowedmimetypes=
"application/mp4,video/mp4"
>
</telerik:RadUpload>
<asp:Button ID=
"BtnUpload"
runat=
"server"
Text=
"Upload"
OnClientClick=
"return checkFileExists()"
onclick=
"BtnUpload_Click"
/>
protected
void
BtnUpload_Click(
object
sender, EventArgs e)
{
//int counter = 0;
string
targetFolder =
string
.Empty;
string
targetFileNameAndPath =
string
.Empty;
string
targetFileNameWithExtension =
string
.Empty;
string
targetFileNameWithoutExtension =
string
.Empty;
string
tempFilename =
string
.Empty;
if
(RadUpload1.UploadedFiles.Count > 0)
{
if
(RadUpload1.InvalidFiles.Count > 0)
{
labelInvalidResults.Visible =
true
;
}
else
{
labelInvalidResults.Visible =
false
;
targetFolder = Server.MapPath(ResolveUrl(
"~/directoryName/"
));
targetFileNameAndPath = Path.Combine(targetFolder, RadUpload1.UploadedFiles[0].GetNameWithoutExtension() + RadUpload1.UploadedFiles[0].GetExtension());
targetFileNameWithExtension = RadUpload1.UploadedFiles[0].GetNameWithoutExtension() + RadUpload1.UploadedFiles[0].GetExtension();
targetFileNameWithoutExtension = RadUpload1.UploadedFiles[0].GetNameWithoutExtension();
tempFilename = targetFileNameWithoutExtension.Replace(
"_"
,
" "
);
RadUpload1.UploadedFiles[0].SaveAs(targetFileNameAndPath);
Thread uploadVideoThread =
new
Thread(() => convertVideoFile(targetFileNameAndPath, targetFileNameWithExtension, targetFileNameWithoutExtension));
uploadVideoThread.Start();
}
}
}
<
system.web
>
<
httpModules
>
<
add
name
=
"RadUploadModule"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
</
httpModules
>
<
httpRuntime
maxRequestLength
=
"102400"
executionTimeout
=
"3600"
/>
</
system.web
>
<
system.webServer
>
<
modules
>
<
add
name
=
"RadUploadModule"
preCondition
=
"integratedMode"
type
=
"Telerik.Web.UI.RadUploadHttpModule"
/>
</
modules
>
<
handlers
>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
verb
=
"*"
preCondition
=
"integratedMode"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
/>
</
handlers
>
</
system.webServer
>
Hi,
I have a dynamic created treeview, each node contains several kinds of user controls. My problem is I can find the "radtextbox" user
control, but I can't find the "checkbox" user control using clientside javascript.
class GrandChildNodeTemplate :ITemplate
{ ...
public void InstantiateIn(Control container)
{
cb.ID = "cb";
cb.Visible = false;
cb.DataBinding += new EventHandler(checkBox_DataBinding);
container.Controls.Add(cb);
rtb.ID = "rtb";
rtb.Visible = false;
rtb.DataBinding += new EventHandler(radTextBox_DataBinding);
container.Controls.Add(rtb);
}
}
page_load
protected void populate(RadTreeNode eNode)
{
GrandChildNodeTemplate grandChildTemplate = new GrandChildNodeTemplate();
RadTreeNode node = new RadTreeNode("gcn");
eNode.Nodes.Add(node);
grandChildTemplate.InstantiateIn(node);
....
cb = (CheckBox)node.FindControl("cb");
cb.Visible = true;
node.Value = thisGuid;
cb.Attributes.Add("onClick", "return findNode('" + thisGuid+ "')");
}
code for clientside
JS += "function findNode(args) { ";
JS += " var tv = $find('"+ rtvReportComponents.ClientID + "'); ";
JS += " var node = tv.findNodeByValue(args);";
JS += " var rtb = node.findControl(\"rtb\"); ";
JS += " if (rtb==null) alert('hello');";
JS += " var cb = node.findControl(\"cb\"); ";
JS += " if (cb==null) alert(args);"; // <--- problem is here. cb==null, can't find checkbox
JS += " if (!cb.checked){";
JS += " rtb.disable();}";
JS += " else{";
JS += " rtb.enable();}";
JS += " }";
ScriptManager.RegisterClientScriptBlock(this, GetType(), "Condition Info", JS, true);
My suspicion is node.findcontrol method can't find the DOM element? Thanks