Hello,
I have a custom ascx controls contains RadGrid and RadChart.
The control is loaded into ajax panel using ajax request
Here is how the event handler is added
Everything works just fne if the control is used on the aspx page (like a normal aspx control). But as soon as I try to load this control dynamically using ajax panel (using the first code snapshot), I get a javascript error: content_CurrencyRates_grid_OnRowSelected is not defined
I am a bit confused why the event handler is not binded to the grid in this scenario. Should this function be placed in some other part of the ascx control?
Thanks,
Andrei
I have a custom ascx controls contains RadGrid and RadChart.
The control is loaded into ajax panel using ajax request
Inside the user control every grid row has a related chart dislayed when this row is selected.protected
void
RadAjaxPanel2_AjaxRequest(
object
sender, AjaxRequestEventArgs e)
{
if
(e.Argument ==
"InitialLoad"
)
{
var auctionTotals = LoadControl(
"~/core/Informers/CurrencyRates.ascx"
);
auctionTotals.ID =
"CurrencyRates"
;
panel2.Controls.Add(auctionTotals);
}
}
function
<%=ClientID%>_grid_OnRowSelected(sender, args) {
<%=ClientID%>_selectChart(parseInt(args._itemIndexHierarchical));
}
Here is how the event handler is added
var events = grid.ClientSettings.ClientEvents;
events.OnRowSelected = ClientID +
"_grid_OnRowSelected"
;
Everything works just fne if the control is used on the aspx page (like a normal aspx control). But as soon as I try to load this control dynamically using ajax panel (using the first code snapshot), I get a javascript error: content_CurrencyRates_grid_OnRowSelected is not defined
I am a bit confused why the event handler is not binded to the grid in this scenario. Should this function be placed in some other part of the ascx control?
Thanks,
Andrei