| <%@ Page Language="C#" AutoEventWireup="true" %> | |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head runat="server"> | |
| <style type="text/css">HTML { font-size: 10pt; font-family: Arial; }</style> | |
| </head> | |
| <body> | |
| <form id="form1" runat="server"> | |
| <asp:ScriptManager ID="ScriptManager1" runat="server" /> | |
| <div> | |
| <telerik:RadTreeView ID="myTree" OnClientNodeChecked="NodeWasChecked" CheckBoxes="true" runat="server"> | |
| <Nodes> | |
| <telerik:RadTreeNode Text="Node A"></telerik:RadTreeNode> | |
| <telerik:RadTreeNode Text="Node B"></telerik:RadTreeNode> | |
| <telerik:RadTreeNode Text="Node C"></telerik:RadTreeNode> | |
| <telerik:RadTreeNode Text="Node D"></telerik:RadTreeNode> | |
| <telerik:RadTreeNode Text="Node E"></telerik:RadTreeNode> | |
| </Nodes> | |
| </telerik:RadTreeView> | |
| <input type="button" value="run repro" onclick="runRepro()" /> (checks every other node) | |
| <script language="javascript" type="text/javascript"> | |
| function runRepro() | |
| { | |
| var tree = $find('<%= myTree.ClientID %>'); | |
| var nodes = tree.get_nodes(); | |
| for (var i=0; i<nodes.get_count(); i++) | |
| if ((i%2)==0) { nodes.getNode(i).check(); } | |
| } | |
| function NodeWasChecked(sender, args) | |
| { | |
| var text = document.createTextNode("Function was called: NodeWasChecked() - " + (new Date()).toString()); | |
| if (ResultsDiv.childNodes.length > 0) | |
| { | |
| ResultsDiv.insertBefore(document.createElement("br"), ResultsDiv.childNodes.item(0)); | |
| ResultsDiv.insertBefore(text, ResultsDiv.childNodes.item(0)); | |
| } | |
| else | |
| { | |
| ResultsDiv.appendChild(text); | |
| } | |
| } | |
| </script> | |
| </div> | |
| <div style="border:1px solid red; margin-top: 50px;"> | |
| <b>Expected Result:</b> clicking the button will not check nodes, but not raise the OnClientNodeChecked() event. | |
| however, manually clicking the checkboxes will raise this event and | |
| <br /><br /> | |
| <b>OnClientNodeChecked() Results:</b> | |
| <div id="ResultsDiv" style="font-size:8pt;"></div> | |
| </div> | |
| </form> | |
| </body> | |
| </html> | |

ImageManager
Anyone that can inform me on coming features wil include this requests? If there are already examples with workaound with the current versions on AJAX or codelibrary?
I think many of this request are quite common...
Regards Pelle
| <telerik:RadComboBox ID="cbo1" AutoPostBack="True" EnableViewState="False" Width="30em" |
| Font-Size="13px" OnSelectedIndexChanged="cbo1_SelectedIndexChanged" |
| CausesValidation="false" OnPreRender="cbo1_PreRender" runat="server" Font-Bold="True" |
| HighlightTemplatedItems="True" MarkFirstMatch="true" EnableLoadOnDemand="true" OnItemsRequested="cbo1_ItemsRequested"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| <ItemTemplate> |
| <table width="100%" cellpadding="0" cellspacing="0"> |
| <tr> |
| <td> |
| <asp:Label ID="lblName" Font-Size="larger" Font-Bold="true" runat="server" |
| Text='<%# DataBinder.Eval(Container.DataItem, "EntityName") %>' /> |
| </td> |
| <td style="text-align: right"> |
| <asp:Panel ID="pnlImage" runat="server"> |
| <asp:Image ID="imgForward" runat="server" ImageUrl="../images/icons/forward.gif" /> |
| </asp:Panel> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
My scenarion is like this, I need to open a radWindow on click of a Imagebutton which is in radGrid dyanamically (server side)
for that I written code to open radwindow in ItemCommad event of radGrid
my problem here is, when I click first time on a Image in radgrid,the debugger passes through the code, the page refreshes and window is added to controls (here the window doesn't open) and when I click on the same image second time the window opens (because the winow is already added to the controls, here the debugger won't go into the code again )
I want to open the window on single mouse click of a image (I want to do this on item command event because I need to pass some value to radwindow on click of a imagebutton), How can I achieve this?
muy code is as follows
protected void rdgSystemGrid_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "Comments")
{
Telerik.Web.UI.GridDataItem item = e.Item as Telerik.Web.UI.GridDataItem;
ImageButton imgComment = (ImageButton)item["comments"].FindControl("imgComments");
ShowWindowPopUp(imgComment
}
private void ShowWindowPopUp(ImageButton imgComment)//, string systemId)
{
RadWindow window = new RadWindow();
window.EnableEmbeddedSkins = false;
window.Title = "Add Comments";
window.Skin = "Default";
window.ShowContentDuringLoad = false;
window.VisibleStatusbar = false;
window.ReloadOnShow = true;
window.Behaviors = WindowBehaviors.Reload | WindowBehaviors.Close | WindowBehaviors.Move;
window.Modal = true;
window.Width = Unit.Parse("500px");
window.Height = Unit.Parse("450px");
window.OpenerElementID = imgComment.ClientID;
this.Controls.Add(window);
window.NavigateUrl = @"~/obt/Dashboard/Comments.aspx";
}
<telerik:GridTemplateColumn UniqueName="comments" HeaderText="Comments" ItemStyle-Width="200px" >
<ItemTemplate>
<asp:ImageButton ID="imgComments" CommandName="Comments" runat="server" ImageUrl="/comments.gif "/>
</ItemTemplate>
</telerik:GridTemplateColumn>
Thanks,