This is a migrated thread and some comments may be shown as answers.

Dynamic Modal Window Titles

2 Answers 136 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Assia asked on 24 Jun 2010, 08:15 PM
I'm currently trying to set a modal window title dynamically from my stored procedure search and it works fine when I add it to the <UpdateControls><telerik:AjaxUpdatedControl> but even though it displays as it should, the window refuses to close now. I tried setting an individual UpdateControl just for the modal window but that did not work as well. A friend of mine suggested somehow using JavaScript to $find("modalComment.ClientID"); but I've never coded in javascript so this poses a bit of an issue to me. Has anyone else tried to set a dyanamic modal window titles from the backend code were able to close the window successfully?
 What I currently have is:
            <telerik:AjaxSetting AjaxControlID="gvSearchResults">  
                    <telerik:AjaxUpdatedControl ControlID="gvSearchResults" /> 
                    <telerik:AjaxUpdatedControl ControlID="modalComment" /> 
                    <telerik:AjaxUpdatedControl ControlID="rptComments" /> 
                    <telerik:AjaxUpdatedControl ControlID="modalStatus" /> 
                    <telerik:AjaxUpdatedControl ControlID="rptStatus" /> 
This displays my title and dynamic content just as is should.

In my actual column that I want to call the window from an image button:

<telerik:GridTemplateColumn UniqueName="Title" HeaderText="Title" InitializeTemplatesFirst="false" SortExpression="Title">  
                            <table cellspacing="0" width="100%">  
                                    <%#Eval("Title") %> <asp:ImageButton ID="imgButton" runat="server" ImageUrl="~/images/icons/16/message_add.png" OnClick="fillModalComment" /> 
                        <ItemStyle HorizontalAlign="Left" /> 
 and the working title code on the backend is:
        public void fillModalComment(object sender, EventArgs e)  
            int reqID = 0;  
            reqID = int.Parse(((ImageButton)sender).CommandArgument);  
            rptComments.DataSource = Comments.GetComments(reqID);  
            MainSearch ms = new MainSearch(reqID);  
            string title = "Comments on " + ms.Title;  
            int len = ms.Title.Length;  
            if (title.Length < 40)  
                modalComment.Title = title;  
                modalComment.Title = title.Substring(0, 40) + "...";  

Any ideas that may avoid the javascript? Or is javascript a necessity in this case?

Thanks in advance.

2 Answers, 1 is accepted

Sort by
Telerik team
answered on 30 Jun 2010, 04:38 PM
Hello Assia,

I am sending you a simple example which demonstrates the modal RadWindow. Please check it out and let me know if it helps you.
Also please check out the following online documentation article:

I hope this helps.

Sincerely yours,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Top achievements
Rank 1
answered on 14 Jul 2010, 03:08 PM
Merci, mnogo mi pomogna! :)
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Top achievements
Rank 1
Share this question