7 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 31 Jan 2012, 05:38 AM
Hello,
Try with RegisterStartupScript to call javascript function from server side events.
C#:
JS:
Thanks,
Princy.
Try with RegisterStartupScript to call javascript function from server side events.
C#:
protected
void
radgrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName ==
"Delete"
)
{
string
openWindowScript =
"<script language='javascript'>function f(){SelectItems(); Sys.Application.remove_load(f) ;}; Sys.Application.add_load(f) ;</script>"
;
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"radalert"
, openWindowScript);
}
}
<script type=
"text/javascript"
>
function
SelectItems()
{
// Your code
}
</script>
Thanks,
Princy.
0

Robert
Top achievements
Rank 1
answered on 25 Oct 2012, 07:26 PM
This doesn't actually work when it's an AJAX call rather than a postback.
0

Princy
Top achievements
Rank 2
answered on 26 Oct 2012, 07:08 AM
Hi,
One suggestion is that you can disable the ajax to invoke the javascript function.
aspx:
JS:
Thanks,
Princy.
One suggestion is that you can disable the ajax to invoke the javascript function.
aspx:
<
telerik:RadAjaxManager
ID
=
"mgrr"
runat
=
"server"
ClientEvents-OnRequestStart
=
"OnRequestStart"
>
</
telerik:RadAjaxManager
>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
asp:Button
ID
=
"Button2"
CommandName
=
"Delete"
runat
=
"server"
Text
=
"Button"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
function
OnRequestStart(sender, args)
{
if
(args.get_eventTarget().indexOf(
"Button2"
) >= 0)
args.set_enableAjax(
false
);
}
Thanks,
Princy.
0

Rk.MooRthy(DLL Version : 2008.3.1314.35)
Top achievements
Rank 1
answered on 18 Jul 2013, 07:06 AM
Its working superb..
But i need to send one string as parameter to Java script.
Can you help me..?
Thanks
Rk.MooRthy
But i need to send one string as parameter to Java script.
Can you help me..?
Thanks
Rk.MooRthy
0

Rk.MooRthy(DLL Version : 2008.3.1314.35)
Top achievements
Rank 1
answered on 24 Jul 2013, 09:23 AM
Yeah Its working fine ! Thanks for your valuable reply..
Thanks
-Rk.MooRthy
Thanks
-Rk.MooRthy
0

Rk.MooRthy(DLL Version : 2008.3.1314.35)
Top achievements
Rank 1
answered on 24 Jul 2013, 09:37 AM
Hi,
I have created one column as "GridButtonColumn" in one dynamic radgrid, When i click a button in any of the row that "GridButtonColumn" column will be hided soon... Can you anyone help me to solve the problem ..?
Thanks
-Rk.MooRthy
I have created one column as "GridButtonColumn" in one dynamic radgrid, When i click a button in any of the row that "GridButtonColumn" column will be hided soon... Can you anyone help me to solve the problem ..?
Thanks
-Rk.MooRthy
0
Hi,
Can you please verify that you are closely following the steps provided in the following article when creating the grid structure dynamically?
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
Or maybe you want to hide the column on purpose when a button is clicked?
Regards,
Eyup
Telerik
Can you please verify that you are closely following the steps provided in the following article when creating the grid structure dynamically?
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
Or maybe you want to hide the column on purpose when a button is clicked?
Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.