This is an example for article How to refer to a client-side control within a UserControl. There is a UserControl with an ASPxPopupControl control. Two instances of the UserControl are put on a page. Each UserControl instance deals with its own popup control. Note the dynamically generated handler for the button's client-side Click event in WebUserControl.ascx code behind.
Question Comments
Added By: Jay Johnson at: 6/10/2015 2:30:42 PM
Trying this with an ASPxRadioButton and getting "Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.CheckEditClientSideEvents does not have a DataBinding event."
Any ideas?
Added By: Jay Johnson at: 6/10/2015 2:31:38 PM<dx:ASPxRadioButton ID="optNo" runat="server" Text="No" GroupName="Answer" Layout="Flow" Theme="MetropolisBlue" >
<ClientSideEvents CheckedChanged= '<%#GetButtonClickHandler()%>' />
</dx:ASPxRadioButton>
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T254117: The "Databinding expressions are only supported on objects that have a DataBinding event. DevExpress.Web.CheckEditClientSideEvents does not have a DataBinding event." error occurs. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
This works for controls where you can bind the function. However it not explain how to bind the javascript function on grid callbacks.
If you have this situation, I have no idea how to adapt openComisarioDetalle:
<script id="dxss_personaluploaderscript" type="text/javascript">
function gridComisionadosCustomButtonClick(s, e) {
gridcomisarios.GetRowValues(e.visibleIndex, "idrecord;name;surname", openComisarioDetalle);
}
function openComisarioDetalle(values) {
//some code here
}
</script>
<dx:ASPxGridView ID="gridcomisarios" runat="server" AutoGenerateColumns="False"
Width="100%" EnableTheming="True" ClientInstanceName="gridcomisarios" EnableViewState="False" Cursor="pointer">
<ClientSideEvents CustomButtonClick="function(s, e) { gridComisionadosCustomButtonClick(s, e); }" />
Hello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T279924: How to create a javascript function in code behind. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.