<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
EnableAJAX="True" onajaxrequest="RadAjaxManager1_AjaxRequest" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGridInStock">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridInStock" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadGridDeleted" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
On the top grid is a column to trigger the delete:
<telerik:GridTemplateColumn UniqueName="DeleteLink">
<ItemTemplate>
<asp:LinkButton ID="DeleteLink" runat="server" Text="Delete" />
</ItemTemplate>
</telerik:GridTemplateColumn>
I associate the javascript with the column with this code:
protected void RadGridInStock_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = e.Item as GridDataItem;
LinkButton button = item["DeleteLink"].Controls[1] as LinkButton;
APO_Vehicle vehicle = item.DataItem as APO_Vehicle;
if (vehicle != null)
{
button.Attributes.Add(
"onclick",
String.Format("return deleteClick({0});",
vehicle.Id));
}
}
}
This calls this javascript:
var deleteId;
function deleteClick(id) {
deleteId = id;
radprompt(
'What is your reason for deleting this car?', promptCallBackFn, 330, 100);
return false;
}
function promptCallBackFn(args) {
// Call an ajax method to delete the record
if (args != null && args.length > 0) {
var arguments;
arguments.id = deleteId;
arguments.reason = args;
$find(
"<%=RadAjaxManager1.ClientID%>").ajaxRequest('{ "id" : ' + arguments.id + ', "reason" : "' + arguments.reason + '" }');
}
}
The Ajax request code is as follows:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
// Code to delete record from db ..
RadGridInStock.Rebind();
RadGridDeleted.Rebind();
}
Is there a way to get the RadAjaxManager to update the grids from the AjaxRequest method? I kind of thought this should happen automatically.
Thanks,
Stuart
| <telerik:RadScriptManager runat="server" ID="RadScriptManager1"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox runat="server" ID="RadComboBox1" Width="300px" Skin="Telerik"> |
| <Items> |
| <telerik:RadComboBoxItem Text="ASP.NET AJAX UI Controls" /> |
| <telerik:RadComboBoxItem Text="WinForms UI Controls" /> |
| <telerik:RadComboBoxItem Text="WPF UI Controls" /> |
| <telerik:RadComboBoxItem Text="Silverlight UI Controls" /> |
| <telerik:RadComboBoxItem Text="Telerik Reporting" /> |
| <telerik:RadComboBoxItem Text="Telerik OpenAccess ORM" /> |
| <telerik:RadComboBoxItem Text="Telerik Sitefinity CMS" /> |
| </Items> |
| </telerik:RadComboBox> |
| <script type="text/javascript"> |
| (function($) { |
| $(document).ready(function() { |
| $('.rcbItem') |
| .mouseover(function() { |
| $(this).stop().animate({ paddingLeft: "30px" }, { duration: 300 }); |
| }) |
| .mouseout(function() { |
| $(this).stop().animate({ paddingLeft: "4px" }, { duration: 300 }); |
| }); |
| }); |
| })($telerik.$); |
| </script> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| <script type="text/javascript"> |
| (function($) { |
| $(document).ready(function() { |
| $('.rcbItem') |
| .mouseover(function() { |
| $(this).stop().animate({ paddingLeft: "30px" }, { duration: 300 }); |
| }) |
| .mouseout(function() { |
| $(this).stop().animate({ paddingLeft: "4px" }, { duration: 300 }); |
| }); |
| }); |
| })($telerik.$); |
| </script> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadComboBox runat="server" ID="RadComboBox1" Width="300px" Skin="Telerik"> |
| <Items> |
| <telerik:RadComboBoxItem Text="ASP.NET AJAX UI Controls" /> |
| <telerik:RadComboBoxItem Text="WinForms UI Controls" /> |
| <telerik:RadComboBoxItem Text="WPF UI Controls" /> |
| <telerik:RadComboBoxItem Text="Silverlight UI Controls" /> |
| <telerik:RadComboBoxItem Text="Telerik Reporting" /> |
| <telerik:RadComboBoxItem Text="Telerik OpenAccess ORM" /> |
| <telerik:RadComboBoxItem Text="Telerik Sitefinity CMS" /> |
| </Items> |
| </telerik:RadComboBox> |
| </div> |
| </form> |
| </body> |
| </html> |
| <script type="text/javascript" src="file.js"> |
What do I wrong?
I have a custom telerik skin and am creating a tooltip on the client side using the tooltip manager and client side code. I'm not able to get the tooltip working with my custom skin. After I applied the custom skin, the tooltip will still show, but without a skin, it's background is transparent.
I created a server side tooltip control to test my custom skin and it works.
I tried adding the custom skin on the tooltip manager control, this had no effect.
Is there a way to specify a custom skin for a tooltip when creating the tooltip from the client side.
Here is snipets of my code:
All css files for my skin are registered in default.aspx, here is the tooltip css:
<link rel="stylesheet" type="text/css" href="/dnn51/Portals/_default/WebControlSkins/MySkin/ToolTip.MySkin.css" />
My tooltip manager is registered in the code behind:
RadToolTipManager tooltipMgr = new RadToolTipManager();
tooltipMgr.Skin = "MySkin";
tooltipMgr.EnableEmbeddedSkins = false;
tooltipMgr.ID = "DefaultToolTipMgr";
Page.FindControl("ToolTipMgrPlaceHolder").Controls.Add(tooltipMgr);
In javascript, I create the tooltips:
function pageLoad() {
jQuery(".myLabel").each(function() {
var html = jQuery(this).children("div").html();
if (html != null && html != "") {
var tooltip = $find(__DefaultTooltipManagerID).createToolTip(jQuery(this).children("img")[0]);
tooltip.set_title("<span style=\"padding:15px\">" + html + "</span>");
}
});
}