Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
461 views
Hi,

We have an in-house CMS. Various functionality happens in modules. Any number and configuration (including duplicates) of modules can be added to a page. Users with appropriate permissions can open a RadWindow that contains a page where they can update the settings for that module.

Currently, when they close the window the whole page reloads with their updated settings. This works but we would like to make it better.

However, we would like to modify this behavior. Each module is wrapped in an update panel. When the RadWindow closes only the appropriate update panel is updated. Even then, if possible it should only update if they click the "update" button in the window and not if they click the "cancel" button or the "X" on the RadWindow.

I have found one solution. However, it seems "hackish".
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Random_String_Control.ascx.cs" Inherits="AJAX_Test.Random_String_Control" %> 
 
<asp:UpdatePanel UpdateMode="Conditional" runat="server"
    <ContentTemplate> 
        <script type="text/javascript"
            function clientClose_<%= Refresh_Random_String.ClientID %>(sender, args) { 
                document.getElementById('<%= Refresh_Random_String.ClientID %>').click(); 
            } 
        </script> 
        <asp:Literal runat="server" ID="Random_String" /> 
        <asp:Button ID="Refresh_Random_String" runat="server" OnClick="Refresh_Random_String_Click" Text="Refresh Random String" /> 
        <rad:RadWindow ID="Window" runat="server" Modal="true" NavigateUrl="http://google.ca" /> 
        <asp:Button ID="Open_Window" runat="server" Text="Open Window" OnClick="Open_Window_Click" /> 
    </ContentTemplate> 
</asp:UpdatePanel> 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace AJAX_Test 
    public partial class Random_String_Control : System.Web.UI.UserControl 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if(!IsPostBack) 
                Random_String.Text = Guid.NewGuid().ToString(); 
            Window.VisibleOnPageLoad = false
            Window.OnClientClose = "clientClose_" + Refresh_Random_String.ClientID; 
        } 
 
        protected void Open_Window_Click(object sender, EventArgs e) 
        { 
            Window.VisibleOnPageLoad = true
        } 
 
        protected void Refresh_Random_String_Click(object sender, EventArgs e) 
        { 
            Random_String.Text = Guid.NewGuid().ToString(); 
        } 
    } 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="AJAX_Test._Default" %> 
 
<!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
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager runat="server" /> 
        <div> 
            1 : 
            <asp:PlaceHolder ID="One" runat="server" /> 
        </div> 
        <br /> 
        <div> 
            2 : 
            <asp:PlaceHolder ID="Two" runat="server" /> 
        </div> 
        <br /> 
        <div> 
            3 : 
            <asp:PlaceHolder ID="Three" runat="server" /> 
        </div> 
    </form> 
</body> 
</html> 
 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace AJAX_Test 
    public partial class _Default : System.Web.UI.Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            One.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); 
            Two.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); 
            Three.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); 
        } 
    } 
 




Is there an easier way to do this?

Thanks,
Jeff Paetkau

PS: If you attempt to attach a zip file, you get the error "File is not of correct type." However, there does not appear to be any way to remove the file. It seems the only way to continue posting is to attach an image.
Georgi Tunev
Telerik team
 answered on 18 Nov 2009
3 answers
196 views
Hi ,
am balaji 

I Have used  Rad Treeview  encapsulated in a Rad ajax panel in my Project.
Here i do different transaction such as drag and drop,context menu,node click and so on.
But everything under Rad ajax panel.
Actually i have Treeview path stored as a datasource in an array.
Am assigning the Path and Storing the Value in Rad Tree node while clicking and dragging that node to destination node.

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="false" EnableHistory="false" > 
                                                <telerik:RadTreeView ID="Reportview" runat="server" AllowNodeEditing="True"    
                                                    EnableDragAndDrop="True" OnNodeExpand="RadTreeview1_NodeExpand" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"   
                                                    OnClientNodeClicked="nodeClicked"   
                                                    OnClientContextMenuShowing="onClientContextMenuShowing"   
                                                    OnNodeEdit="RadTreeView1_NodeEdit" OnNodeDrop="RadTreeView1_HandleDrop" > 
                                                    <ContextMenus> 
                                                        <telerik:RadTreeViewContextMenu Skin="Outlook" ID="FolderContextMenu" runat="server">  
                                                           <%-- <WebServiceSettings Method="LoadFolderitems" Path="WebService.asmx" /> 
                                                             <WebServiceSettings Method="LoadReportitems" Path="WebService.asmx" />--%> 
                                                              <Items> 
                                                              <telerik:RadMenuItem Value="Create Folder" Text="Create Folder" ImageUrl="img/Outlook/10.gif">  
                                                              </telerik:RadMenuItem> 
                                                              <telerik:RadMenuItem Value="Copy Policies" Text="Copy Policies">  
                                                              </telerik:RadMenuItem> 
                                                              <telerik:RadMenuItem Value="Paste Policies" Text="Paste Policies" Enabled="false">  
                                                              </telerik:RadMenuItem> 
                                                              </Items> 
                                                        </telerik:RadTreeViewContextMenu> 
                                                          
                                                        <telerik:RadTreeViewContextMenu Skin="Outlook" ID="ReportContextMenu" runat="server">  
                                                           <%-- <WebServiceSettings Method="LoadFolderitems" Path="WebService.asmx" /> 
                                                             <WebServiceSettings Method="LoadReportitems" Path="WebService.asmx" />--%> 
                                                              <Items> 
                                                                
                                                              <telerik:RadMenuItem Value="Copy Policies" Text="Copy Policies">  
                                                              </telerik:RadMenuItem> 
                                                               <telerik:RadMenuItem Value="Paste Policies" Text="Paste Policies" Enabled="false">  
                                                              </telerik:RadMenuItem> 
                                                              </Items> 
                                                        </telerik:RadTreeViewContextMenu> 
                                                    </ContextMenus> 
                                                    <Nodes> 
                                                        <telerik:RadTreeNode runat="server" Expanded="True" ExpandMode="ServerSideCallBack" 
                                                            Text="Root" Value="/" ImageUrl="~/images/12.gif">  
                                                        </telerik:RadTreeNode> 
                                                    </Nodes> 
                                                </telerik:RadTreeView> 
                                                    
                                                <input type="hidden" id="status" runat="server" /> 
                                                <input type="hidden" id="draggednodepath" runat="server" /> 
                                                <input type="hidden" id="dropstatus" runat="server" /> 
                                                <input type="hidden" id="Nodeid" runat="server" /> 
                                               </telerik:RadAjaxPanel> 
 
In This Treeview i deal with lot of Operations such as drag and drop mcontext menu items as you can see in the Above Respective events.  
OnNodeExpand="RadTreeview1_NodeExpand" OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"   
                                                    OnClientNodeClicked="nodeClicked"   
                                                    OnClientContextMenuShowing="onClientContextMenuShowing"   
 

Here is the RadHandle_Drop Event where i assign Node value the  Path.

 
  protected void RadTreeView1_HandleDrop(object sender, RadTreeNodeDragDropEventArgs e)  
    {  
        RadTreeNode sourceNode = e.SourceDragNode;  
        RadTreeNode destNode = e.DestDragNode;  
          
        RadTreeViewDropPosition dropPosition = e.DropPosition;  
        try  
        {  
            if (sourceNode.TreeView.SelectedNodes.Count <= 1)  
            {  
                if (destNode.ToolTip != "Report")  
                {  
                    if (!sourceNode.IsAncestorOf(destNode))  
                    {  
                        string srcvalue = sourceNode.FullPath;  
                        string target = destNode.FullPath;  
 
                        if (!target.Contains(destNode.Text))  
                        {  
                            targettarget = target + destNode.Text;  
                        }  
 
                        if (srcvalue.StartsWith("Root"))  
                        {  
                            srcvaluesrcvalue = srcvalue.Replace("Root", "");  
                            //srcvaluesrcvalue=srcvalue.Substring(0,srcvalue.LastIndexOf("/"));  
                        }  
 
                        Uri uri = new Uri(Request.Cookies["reporturl"].Values["uri"].ToString());  
                        rs.Url = Request.Cookies["reporturl"].Values["uri"].ToString();  
                        NetworkCredential netCredential = new NetworkCredential(Request.Cookies["Reportcredent"].Values["Username"].ToString(), Request.Cookies["Reportcredent"].Values["pwd"].ToString(), Request.Cookies["Reportcredent"].Values["Domain"].ToString());  
                        ICredentials credential = netCredential.GetCredential(uri, "Basic");  
                        rs.Credentials = credential;  
                        if (target.LastIndexOf("/") > 0)  
                        {  
                            targettarget = target + "/" + srcvalue.Substring(srcvalue.LastIndexOf("/"));  
                            targettarget = target.Replace("//", "/").Replace("//", "/");  
                            targettarget = target.Replace("Root", "");  
                            if (sourceNode.ToolTip == "Folder")  
                            {  
                                Cache["NodeType"] = "Folder";  
                            }  
                            else  
                            {  
                                Cache["NodeType"] = "Report";  
                            }  
                        }  
                        else  
                        {  
                            if (target.StartsWith("Root"))  
                            {  
                                targettarget = target.Replace("Root", "");  
                            }  
 
 
                            target = srcvalue.Substring(srcvalue.LastIndexOf("/"));  
 
                            welcomemsg.Visible = false;  
                            if (sourceNode.ToolTip == "Folder")  
                            {  
                                Cache["NodeType"] = "Folder";  
                            }  
                            else  
                            {  
                                Cache["NodeType"] = "Report";  
                            }  
 
 
 
 
 
                        }  
 
 
 
 
 
 
 
 
 
 
                        rs.MoveItem(srcvalue, target);  
 
                        sourceNode.Owner.Nodes.Remove(sourceNode);  
                        destNode.Nodes.Add(sourceNode);  
                        draggednodepath.Value = target;  
                        destNode.Value = target;  
                         
                        destNode.Category = target;  
                        destNode.Expanded = true;  
                        dropstatus.Value = "true";  
 
                         
                    }  
 
                }  
                else  
                {  
                    welcomemsg.Visible = true;  
                    Addpane.Visible = false;  
                    rightpane.Visible = false;  
                    rightpanepolicies.Visible = false;  
                    welcomemsg.Text = "You cant Drag And Drop Report to a Report";  
                }  
                  
            }  
     
 
 
        }  
        catch (Exception ex)  
        {  
            if (ex.Message.Contains("already exists"))  
            {  
                welcomemsg.Visible = true;  
                Addpane.Visible = false;  
                rightpane.Visible = false;  
                rightpanepolicies.Visible = false;  
                welcomemsg.Text = "There cannot be a Report with the Same name in a Folder";  
            }  
            else  
            {  
                Util.LogException(ex);  
            }  
              
        }  
                sourceNode.TreeView.ClearSelectedNodes();  
    }  
 

when i try to retrieve the Exact path on some other Node Click event am not getting the Recent Value that is assigned in the Handle Drop event.
due to this am getting lot of uncertainities.
The Value is not Persistent  and not committed.
Is there any Way or code to enable it.
Can any one Help me .
Thanks
Regards
N.Balaji

 

 

Veselin Vasilev
Telerik team
 answered on 18 Nov 2009
1 answer
89 views
HI

I dont know if have a bug on radcontrol or on my code, but, i add a custom command to raddock and i can see the icon only after move this dock.

Can you help-me please ?

 
 Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock 
            Dim dock As New RadDock() 
 
            dock.DockMode = DockMode.Docked 
            dock.ID = String.Format("RadDock{0}", state.UniqueName) 
            dock.ApplyState(state) 
 
            Dim botaoEditar As DockCommand = New DockCommand 
            botaoEditar.Name = "EDITAR" 
            botaoEditar.Text = "editar" 
            botaoEditar.AutoPostBack = True 
 
            AddHandler dock.Command, AddressOf dock_Command 
 
            dock.Commands.Add(botaoEditar) 
            dock.Commands.Add(New DockCloseCommand()) 
            dock.Commands.Add(New DockExpandCollapseCommand()) 
 
            Return dock 
        End Function 
 

Pero
Telerik team
 answered on 18 Nov 2009
1 answer
57 views
Hi,

So very late to the party here, just upgraded to latests 09 release only to realize that WebBlue skin from our 08 Q3 release is no longer the same...and the new one is terrible.

Read through some threads/blog posts here about it.

So  besides All RadControls Q3 2008 Skins Are Now Compatible with the Q1 2009 Release

Are there are no other ways to embed the old versions of themes into an assembly or something like that?

instead of manual per page registration? Or is there?  And I just can't find it?

After nearly a year and several Q releases, I'd imagine you guys, Telerik, could have converted older themes and embedded them with the new ones?

Thanks
Ivo
Telerik team
 answered on 18 Nov 2009
1 answer
87 views
Hi, I am using the raddock control but when the tried to set the font on the title in the css nothing happened. so I checked the html code generated only to find that the class="rdTitle" is missing. the dockhandle is set to TitleBar, dockmode is default. here is the code

 

 

 

<telerik:RadDock ID="RadDock1" Runat="server" Width="100%"

 

 

 

Title="Message">

 

 

 

<ContentTemplate>

 

 

 

<br />

 

 

 

<asp:Button ID="Button1" runat="server" Text="New message"

 

 

 

CssClass="btnSmall" Width="162px" />

 

 

 

<br />

 

 

 

<br />

 

 

 

<asp:Button ID="Button2" runat="server" Text="Open message"

 

 

 

CssClass="btnSmall" Width="162px" />

 

 

 

<br />

 

 

 

</ContentTemplate>

 

 

 

</telerik:RadDock>

 


HTML code from browser

<tr class="rdTop">
    <td unselectable="on" class="rdLeft">&nbsp;</td>
    <td class="rdCenter"><div id="ctl00_pageContent_RadDock1_T" class="rdTitleBar">
     <em>Message</em><ul class="rdCommands"><li><a title="Collapse"><span  class="rdCollapse">&nbsp;</span></a></li><li><a title="Close"><span class="rdClose">&nbsp;</span></a></li></ul>
    </div></td>
    <td unselectable="on" class="rdRight">&nbsp;</td>
   </tr>

you can see that the <em>Message</em> should be <em class="rdTitle">Message</em> but is not.

many thanks.

Sean
Pero
Telerik team
 answered on 18 Nov 2009
3 answers
171 views
We have a Q1 2009 RadToolbar, with a Radcombobox load-on-demand autosuggest search input in one template button. In the next, we have a RadToolBarbutton acting as the Submit search button.  This setup has worked fine for a long time, however recently switching our Dotnetnuke page state persistence to 'Memory' from 'Page' results in the unusual behaviour that clicking the search submit button, does not seem to fire the server-side button click event, it just does a postback and nothing happens.

Strangely,the exact same code works on a child dotnetnuke portal, just not on the parent portal. We would really like to use Memory state persistence as it delivers much better clientside performance, and so far this button not posting back seems to be the only hang-up. 

Can someone please say why this button event would no longer fire, based on in-page viewstate vs memory/session viewstate? It is Dotnetnuke 4.9.1.

.ascx:
<%@ Control language="vb" Inherits="MySite.Modules.Search.ViewSearch" CodeFile="ViewSearch.ascx.vb" AutoEventWireup="false" %><%@ Register TagPrefix="dnn" TagName="SCBreadcrumb" Src="~/DesktopModules/SCBreadcrumb/SCBreadcrumb.ascx" %><script type="text/javascript">function OnASClientItemsRequestFailedHandler(sender, eventArgs){eventArgs.set_cancel(true);}var myTimer=null;var isTimerRunning=false;function KeyPressHandler(comboBox,eventArgs){if(isTimerRunning){stopTimer();}myTimer=setTimeout('requestItems()',500);isTimerRunning=true;}function RequestingHandler(sender, eventArgs){if (sender.get_text().length < 3){eventArgs.set_cancel(true);}}function stopTimer(){if(isTimerRunning){clearTimeout(myTimer);timerRunning=false;}};function RadComboKeyPress(sender, eventArgs) {var keyCode = eventArgs.get_domEvent().keyCode;if (keyCode == 13) {var toolbar1 = $find("<%= RadToolBarSearch.ClientID %>");var templateButton = toolbar1.findItemByValue("MainSearch");templateButton.click();}}</script><table width="100%"><tr><td align="left"><telerik:RadToolBar runat="server" ID="RadToolBarSearch" Skin="Telerik" EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" OnButtonClick="RadToolBarSearch_ButtonClick" EnableLoadOnDemand="False" EnableViewstate="False" style="width:100%;display: block; float: none;min-width:500px;"><Items><telerik:RadToolBarButton id="SearchTemplate" Value="TemplateTextBox" Text="BasicSearch"><ItemTemplate><telerik:RadComboBox Skin="Hay" id="RadComboBoxAS" Runat="server" Width="215px"  EnableItemCaching="True" AllowCustomText="true" MarkFirstMatch="false"  EnableLoadOnDemand="true" EmptyMessage="Enter keyword(s)"  OnClientKeyPressing="RadComboKeyPress" OnClientItemsRequestFailed="OnASClientItemsRequestFailedHandler" OnItemsRequested="RadComboBoxAS_ItemsRequested" HighlightTemplatedItems="true" DataTextField="strKeyword" EnableViewstate="False" LoadingMessage = "<img src=/images/loading1.gif height=7px width=51px>" AnimationType="None" ShowToggleImage="False" EnableTextSelection="True"></telerik:RadComboBox></ItemTemplate></telerik:RadToolBarButton><telerik:RadToolBarButton id="SearchSubmitTemplate" text="SEARCH" Group="Search" AllowSelfUncheck="true" value="MainSearch" ImageURL="http://css.zymmetrical.com/search-stock-photos.png" ImagePosition = "1" checked="True" cssclass="CustomItem"></telerik:RadToolBarButton><telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton><telerik:RadToolBarButton id="BCTemplate"><itemtemplate>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<dnn:SCBreadcrumb runat="server" CSSClass="copyright" id="dnnBreadcrumb" Separator="&nbsp;&raquo;&nbsp;" RootLevel="0" LastAsSpan="False" /></itemtemplate></telerik:radtoolbarbutton></items></telerik:RadToolBar> 

button fire event:
Public Sub RadToolBarSearch_ButtonClick(ByVal sender As ObjectByVal e As RadToolBarEventArgs) 
If  e.Item.Value = "MainSearch" THEN 
Dim keywords As String 
If len(keywords)< 1 THEN 
    Response.Write("<script>alert('Please type some keywords in the box and then click Search button');</script>")   
    Else         
Response.Redirect (lcase("/search-results/keyword/" + keywords + "/")) 
End if 
End Sub   

Zyguy
Top achievements
Rank 1
 answered on 18 Nov 2009
1 answer
103 views
I am not sure I did the styling properly, but I was able to get the 35px image to appear for the arrow in the dropdown. Unfortunately, the clickable area is still the original area. If I click about where the arrow is, nothing happens.

I know this is because the image is really the background image, and not a button, but what is the proper way to make that whole cell react to the mouse click?

 
div.RadComboBox  
 border-style:outset; 
 border-color:#bbd1b1; 
 
div.RadComboBox td.rcbArrowCell  
    min-width:35px; 
}  
 
div.RadComboBox td.rcbArrowCellRight {  
    background: url('/images/app/upload_arrow.png') no-repeat !important; 
    width:35px; 
}  
     
div.RadComboBox  .rcbInput 
    font-size:14px; 
    font-family:Helvetica Neue, Arial; 
    font-weight:bold; 
    background:#ffffff;  
    color:Red; 

Simon
Telerik team
 answered on 18 Nov 2009
3 answers
126 views
Hi
I have a grid in a right-to-left page.
after page load, the numbers in paging area in left to right and when you move mouse on this area,
numbers jump to right and it becomes right to left.
also the filtering menu after opening is lrft to right and when you move mouse on it, jumps to right becomes right to left.
you can try it on our production server at this address:
http://95.38.44.247:12/UI/BasicSetting/PlacesDefinition.aspx
thanks in advance.
Veli
Telerik team
 answered on 18 Nov 2009
5 answers
151 views
Hi, I´am using docks. I need dynamic add dock and  save it in Database. My problem is when I drag dock and move it, automaticaly create same dock on old place and this dock is not react. Could you help me this is my codedownloaded here http://mriha.asp2.cz/DynamicADDdock.rar

 

 

 

Pero
Telerik team
 answered on 18 Nov 2009
3 answers
192 views
I am working with the RadGrid, which contains 22 columns.

All is OK, but when the Add New record button is pressed the following scenario occurs :

Due to the large number of columns, a semi-transparent bar runs across the middle section of the screen.  

With 22 columns, the Add New Record section takes up half of the screen.

I am writing to determine if it is possible to show a clear screen when adding a new record, as is the case when editing an existing record.

In Design time, i noticed the footer section is in the middle of the screen, and the Height of the RadGrid is set to 750 px.

The RadGrid skin is set to Default.

Thanks in advance for any insight!

Best regards, Rob
Martin
Telerik team
 answered on 18 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?