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,