<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6492418674816580623</id><updated>2024-09-04T13:42:33.513-07:00</updated><category term="danny fabian duran vesga"/><category term="java script"/><category term="javascript"/><category term="onclick radgrid"/><category term="onclick radtoolbar"/><category term="problem onclcik radgrid"/><category term="radcontrols"/><category term="radtoolbar"/><category term="telerik"/><title type='text'>RadControls en Visual Studio.Net</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ingtelerik.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6492418674816580623/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ingtelerik.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14389045415125715406</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6492418674816580623.post-899519119738597434</id><published>2012-01-31T15:59:00.000-08:00</published><updated>2012-03-08T06:09:41.133-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="danny fabian duran vesga"/><category scheme="http://www.blogger.com/atom/ns#" term="java script"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="onclick radgrid"/><category scheme="http://www.blogger.com/atom/ns#" term="onclick radtoolbar"/><category scheme="http://www.blogger.com/atom/ns#" term="problem onclcik radgrid"/><category scheme="http://www.blogger.com/atom/ns#" term="radcontrols"/><category scheme="http://www.blogger.com/atom/ns#" term="radtoolbar"/><category scheme="http://www.blogger.com/atom/ns#" term="telerik"/><title type='text'>Problema evento onclick radtoolbar en el cliente</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Existe un error típico en el manejo de eventos en los RadControls de Telerik, para este caso hablo de una mezcla de radtoolbar con radgrid. Para contextualizar mejor, el caso trata de una simple grilla como la siguiente:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-xagww-GnXM8/Tyh81ilFRMI/AAAAAAAAACs/mxFzmWIeB-4/s1600/grilla.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-xagww-GnXM8/Tyh81ilFRMI/AAAAAAAAACs/mxFzmWIeB-4/s1600/grilla.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: left;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-xagww-GnXM8/Tyh81ilFRMI/AAAAAAAAACs/mxFzmWIeB-4/s1600/grilla.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: justify;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;117&quot; src=&quot;http://2.bp.blogspot.com/-xagww-GnXM8/Tyh81ilFRMI/AAAAAAAAACs/mxFzmWIeB-4/s320/grilla.PNG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;Ahora tenemos un radToolbar, con el cual queremos eliminar uno o varios registros de la grilla, esto manejando los el evento del onclick desde el lado del cliente usando el siguiente código:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;%=RadToolbar.ClientID%&amp;gt;.attachEvent(&quot;OnClientClick&quot;,&quot;RadToolbar_OnClientClick&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;function RadToolbar_OnClientClick(sender, e)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; {&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Nuestra funcionalidad&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&quot;Evento controlado&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Hasta aquí, pareciera no haber ningún problema, por lo cual ejecutamos la acción y efectivamente, podemos ver el mensaje &quot;Evento controlado&quot;, pero si tratamos nuevamente de generar la acción, este manejador se salta y no podemos ver nuestro mensajito. ¿Por qué?&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Sucede que al actualizar a través de RadAjax el evento OnClick se libera, o en otras palabras, se borra el atributo para el evento, por lo cual no se va a ejecutar hasta que recargues la página nuevamente. ¿Solución?&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Pues si no hubiera solución no estaríamos aquí. Lo que debemos hacer es usar la propiedad &quot;ClientEvents-OnResponseEnd&quot; del RadAjaxManager con la cual vamos a enlazar nuevamente el evento para el radToolbar de esta manera:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Adicionamos la propiedad con el nombre del evento script que se va a implementar para volver a enlazar el control a su evento&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;ClientEvents-OnResponseEnd=&quot;OnResponseEndHandler&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Luego adicionamos el evento script o viceversa&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;function OnResponseEndHandler(sender, arguments)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;%=RadToolbar.ClientID%&amp;gt;.attachEvent(&quot;OnClientClick&quot;,&quot;RadToolbar_OnClientClick&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
Luego ejecutemos la acción cuantas veces necesitamos, y tendremos un manejo continuo del evento. Espero esto sirva de ayuda...&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; color: #073763;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://ingtelerik.blogspot.com/feeds/899519119738597434/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://ingtelerik.blogspot.com/2012/01/problema-evento-onclick-radtoolbar-en.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6492418674816580623/posts/default/899519119738597434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6492418674816580623/posts/default/899519119738597434'/><link rel='alternate' type='text/html' href='http://ingtelerik.blogspot.com/2012/01/problema-evento-onclick-radtoolbar-en.html' title='Problema evento onclick radtoolbar en el cliente'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14389045415125715406</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-xagww-GnXM8/Tyh81ilFRMI/AAAAAAAAACs/mxFzmWIeB-4/s72-c/grilla.PNG" height="72" width="72"/><thr:total>2</thr:total></entry></feed>