ClientScript.RegisterStartupScript(
this.GetType(), "EnableCabType", "UncheckSelectAll('" + chkJobCategoryAll.ClientID + "','" + cblJobCategory.ClientID + "','" + cblCabinetType.ClientID + "','" + chkCabinetAll.ClientID + "');", true);
Seems the above script not at all fired in the ItemDataBound event of RadGrid's popup. Need this to be fired only from ItemDataBound
Any workarounds
Thanks
Regards
Raj
6 Answers, 1 is accepted
0
Hi Rajz,
Use the ScriptManager.RegisterStartupScript() method instead:
Greetings,
Iana
the Telerik team
Use the ScriptManager.RegisterStartupScript() method instead:
ScriptManager.RegisterStartupScript(Page,
typeof
(Page),
"EnableCabType"
,
"UncheckSelectAll('"
+ chkJobCategoryAll.ClientID +
"','"
+ cblJobCategory.ClientID +
"','"
+ cblCabinetType.ClientID +
"','"
+ chkCabinetAll.ClientID +
"');"
,
true
);
Greetings,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

wilbert
Top achievements
Rank 1
answered on 10 Jun 2014, 05:29 AM
same condition in posting,, it's not firing in ItemDataBound Ragrid eventhough I already use that code
can you give me information about that ?
//disable img
ScriptManager.RegisterStartupScript(Page, typeof(Page), "script",
"<
script
type
=
'text/javascript'
>$('[ID*=DivImgSelect]').off('click');</
script
>", false);
0

wilbert
Top achievements
Rank 1
answered on 11 Jun 2014, 08:35 AM
so anyone can't give the solution,,,, help please ? I want to know
0

Princy
Top achievements
Rank 2
answered on 12 Jun 2014, 04:46 AM
Hi Wilbert,
I'm not clear about your requirement, i guess you want to cancel an ImageButton click, which is inside an ItemTemplate. You can try the following code snippet.
C#:
JS:
Thanks,
Princy
I'm not clear about your requirement, i guess you want to cancel an ImageButton click, which is inside an ItemTemplate. You can try the following code snippet.
C#:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
ImageButton imbShow = (ImageButton)dataItem.FindControl(
"imbShow"
);
imbShow.Attributes.Add(
"onClick"
,
"CancelClick('"
+imbShow.ClientID+
"');return false;"
);
}
}
JS:
<script type=
"text/javascript"
>
function
CancelClick(img) {
return
false
;
}
</script>
Thanks,
Princy
0

wilbert
Top achievements
Rank 1
answered on 12 Jun 2014, 06:37 AM
Hi Princy
FYI I Want to appear data when in first load on condition disable Jquery function can't work so I put ScriptManager.RegisterStartupScript(Page, Page.GetType(), "1", "Sys.Application.add_load(function(){{alert('success');}}, 0);", true); in itemdatabound to appear it, but it doesn't work
FYI I Want to appear data when in first load on condition disable Jquery function can't work so I put ScriptManager.RegisterStartupScript(Page, Page.GetType(), "1", "Sys.Application.add_load(function(){{alert('success');}}, 0);", true); in itemdatabound to appear it, but it doesn't work
0

Princy
Top achievements
Rank 2
answered on 13 Jun 2014, 06:28 AM
Hi Wilbert,
Please try the following code snippet.
C#:
JS:
Thanks,
Princy
Please try the following code snippet.
C#:
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
string
script =
"function f(){Check(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
;
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"key"
, script,
true
);
}
}
JS:
<script type=
"text/javascript"
>
function
Check() {
alert(
"Fired"
);
}
</script>
Thanks,
Princy