Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
88 views
Hi Guys,

I need help in saving a state of a control..
I want to put a button "SAVE" when you click on that, the current state of the controls like Radgrid data, Rad filter values, Rad treeview nodes should be saved in a file format. And when you Open that file  the page should be loaded and User can  work on the page as usual..IS this possible in TELERIK..??

THANKS IN ADVANCE
KIRAN 
Iana Tsolova
Telerik team
 answered on 24 Oct 2011
1 answer
98 views
is there any method for acces to local folders/files with this control or other?
Dobromir
Telerik team
 answered on 24 Oct 2011
1 answer
69 views
Hi I am working on a project which has a user control containing a Telerik Tree View on a page, with an information panel on the main page. The user can traverse the tree in the usercontrol which contains folders and items, and if they click an item it loads the information for that item into the main page.

This is handled by using delegates in the user control, and subscribing to that bubbled event in the master page.

I have wrapped this up with a RadAjaxManager, and I want the information panel to have a LoadingPanel displayed over it ONLY when an item is selected, but not a folder. In the user control we do not raise the event if the item is a folder.

I haven't had any luck with this.

I have created a project which displays this behaviour. You can see that when the folders are clicked they also display the loading panel over the main panel, which is what I want to prevent. This is because in production environment, clicking a folder expands the folder but does not reload the main information, but having the loading panel put over it gives the user the impression that it is reloaded.

Can you please help me get this working?

My project contains two files, Default.aspx and FolderView.ascx

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="testlab" TagName="treeview" Src="~/FolderView.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
 
    <telerik:RadScriptManager id="RadScriptManager1" runat="server" />
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlTreeView1" />
                    <telerik:AjaxUpdatedControl ControlID="pnl1" LoadingPanelID="LoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Windows7" />
 
    <div>
    <table>
        <tr>
        <td valign="top">
            <asp:Panel ID="pnlTreeView1" runat="server">
                <testlab:treeview runat="server" id="treeview1" OnItemSelected="treeview1_ItemSelected">
                </testlab:treeview>
            </asp:Panel>
        </td>
        <td valign="top">
            <asp:Panel ID="pnl1" runat="server" Width="450" Height="450">
                Select a node.<br />
                <asp:Label ID="lbl1" runat="server" />
            </asp:Panel>
        </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void treeview1_ItemSelected(object sender, LAB_FolderView.ItemSelectedEventArgs e)
    {
        lbl1.Text += e.SeletedItemText + " clicked, category = " + e.StorageItemType + "<br/>";
    }
}

FolderView.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="FolderView.ascx.cs" Inherits="LAB_FolderView" %>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" />
<div style="border:solid 1px black;">
<telerik:RadTreeView
    ID="RadTreeView1"
    runat="server"
    OnNodeExpand="RadTreeView1_NodeExpand"                     
    OnNodeClick="RadTreeView1_NodeClick"
    Width="300" Height="300"
>
    <Nodes>
        <telerik:RadTreeNode Value="FRUIT" Text="Fruit" Expanded="false" Category="FOLDER" ImageUrl="folder.gif" ExpandedImageUrl="FolderOpen.gif">
            <Nodes>
                <telerik:RadTreeNode Value="ORANGE" Text="Orange" Category="ITEM"/>
                <telerik:RadTreeNode Value="BANANA" Text="Banana" Category="ITEM"/>
                <telerik:RadTreeNode Value="APPLE" Text="Apple" Category="ITEM"/>
                <telerik:RadTreeNode Value="TAMARILLO" Text="Tamarillo" Category="ITEM"/>
            </Nodes>
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Value="VEGETABLE" Text="Vegetable" Expanded="false" Category="FOLDER" ImageUrl="folder.gif" ExpandedImageUrl="FolderOpen.gif">
            <Nodes>
                <telerik:RadTreeNode Value="LETTUCE" Text="Lettuce" Category="ITEM"/>
                <telerik:RadTreeNode Value="POTATO" Text="Potato" Category="ITEM"/>
                <telerik:RadTreeNode Value="BROCCOLI" Text="Brocolli" Category="ITEM"/>
                <telerik:RadTreeNode Value="ONION" Text="Onion" Category="ITEM"/>
            </Nodes>
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>
<div id="divDebug" runat="server" />
</div>

FolderView.ascx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik;
using Telerik.Web.UI;
 
public partial class LAB_FolderView : System.Web.UI.UserControl
{
 
    #region Event Bubbling
 
    public enum StorageFolderItemType
    {
        FOLDER,
        ITEM
    }
 
    public class ItemSelectedEventArgs : EventArgs
    {
        public string SelectedItemsValue { get; set; }
        public string SeletedItemText { get; set; }
        public StorageFolderItemType StorageItemType { get; set; }
    }
    public class ItemDeletedEventArgs : EventArgs
    {
        public string SelectedItemsValue { get; set; }
        public string SeletedItemText { get; set; }
        public StorageFolderItemType StorageItemType { get; set; }
    }
     
//  Item Selected
    public delegate void ItemSelectedEventHandler(object sender, ItemSelectedEventArgs e);
    public event ItemSelectedEventHandler ItemSelected;
    protected virtual void OnItemSelected(RadTreeNodeEventArgs e)
    {
         
        ItemSelectedEventArgs args = new ItemSelectedEventArgs();
        args.SelectedItemsValue = e.Node.Value;
        args.SeletedItemText = e.Node.Text;
        args.StorageItemType = e.Node.Category == "FOLDER" ? StorageFolderItemType.FOLDER : StorageFolderItemType.ITEM;
        ItemSelected(this, args);
    }
 
    #endregion
 
 
 
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        Debug(e.Node.Text + " clicked, category = " + e.Node.Category);
        if (e.Node.Category == "ITEM")
        {  
        //  LoadIDPDevelopmentNeedItem(Int32.Parse(e.Node.Value.TrimStart("I".ToCharArray())), VIEW_MODE.VIEW);
            OnItemSelected(e);
        }
    }
    protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e)
    {
        Debug("NodeExpand called on " + e.Node.ID);
    }
 
    protected void Debug(object o)
    {
        divDebug.InnerHtml += o.ToString() + "<br/>";
    }
 
}

 

Iana Tsolova
Telerik team
 answered on 24 Oct 2011
1 answer
46 views
On Clicking 'F11' page moves up and does not readjust to complete page height.
This problem comes when we update to latest version of telerik Q2.

Please suggest to remove this issues..


Dobromir
Telerik team
 answered on 24 Oct 2011
3 answers
123 views
Greetings,

I studied this :

http://www.telerik.com/support/kb/aspnet-ajax/grid/using-radwindow-for-editing-inserting-radgrid-records.aspx

This is working perfectly but i need to send the row ID to a radwindow not to edit data but to display informations from another table using this ID.

Thanks in advance for your help

Adigard
Top achievements
Rank 1
 answered on 24 Oct 2011
0 answers
37 views
Hello,
 
       (I have AjaxPanel placed inside ContentPlaceHolder under some page which includes AjaxLoadingPanel  targetting by AjaxPanel.
 I placed many control inside AjaxPanel during postback event AjaxLoadingPanel will be loaded).


       Now I have two ContentPlaceHolder under Master-Page. One ContentPlaceHolder as Menu with MenuItem say delete, Add, Save  and another ContentPlaceHolder will hold all the controls associated with some page with whom this Masterpage is referenced.
     Whenever I click menu-Item say delete button, under respective page which is active and with whom this Masterpage  is associated should show AjaxLoadingPanel.

  Briefly: I have to fire AjaxLoadingPanel under some page, using control placed under MasterPage whenever I required.

(We are evaluating asp.net ajax)
Please help me on this Regards,
Gautham

     

 




gautham
Top achievements
Rank 1
 asked on 24 Oct 2011
3 answers
310 views
hi

Im facing here some dilema , I am using the radupload control to push some files to the server , they will be dropped in some folder i defined in the control with  TargetFolder , i have subscribed the FileExists event handler to check if some file with the same name exists on target everything is fine till here, the thing is that when a file is renamed to not overwrite another in the destination folder i cannot update its new name on the radupload control let me explain
void RadUpload1_FileExists(object sender, Telerik.Web.UI.Upload.UploadedFileEventArgs e)
       {
           int counter = 1;
           UploadedFile file = e.UploadedFile;
           string targetFolder = Server.MapPath(this.RadUpload1.TargetFolder);
           string targetFileName = System.IO.Path.Combine(targetFolder,
               file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
           while (System.IO.File.Exists(targetFileName))
           {
               counter++;
               targetFileName = System.IO.Path.Combine(targetFolder,
                   file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
           }
           file.SaveAs(targetFileName);
           file.FileName = System.IO.Path.GetFileName(targetFileName); // <---- this line here
            }

i need this because later i loop through uploaded files , and do some more processing on them ... i can think on several ways to go arround this but isnt conceptually wrong not beeing able to update the filename ???

thanks for your time , and i hope im not missing something obvious
Dimitar Terziev
Telerik team
 answered on 24 Oct 2011
1 answer
81 views

I’ve tried the following to clear all selection from a TreeList:

tlConfig.SelectedItems.Clear()

 

Nothing was removed from the selected collection. I then used the brute force method and it works:

For Each selectedItem As TreeListDataItem In tlConfig.SelectedItems

    selectedItem.Selected = False

Next

 

Am I missing something with the Clear() method?

Thanks,
Paul

Marin
Telerik team
 answered on 24 Oct 2011
1 answer
285 views
I'm not sure if anyone's asked about this specific issue before but I wasn't able to find it when I searched.  I'm trying to use a combobox as an autocomplete textbox using EnableLoadOnDemand but when I type into it it keeps giving me the javascript error: "There is no assigned data source.  Unable to complete callback request."  I was working when I first put it in but I can't seem to get it back to the way it was when it worked.  Is there anything anyone can think of that I can look at as to why it wouldn't be working.  These are the settings that I am setting in the codebehind.

combo.EnableAutomaticLoadOnDemand = true
combo.ItemsPerRequest = 15
combo.EnableVirtualScrolling = true
combo.ShowMoreResultsBox = true
combo.ShowDropDownOnTextboxClick = true
Princy
Top achievements
Rank 2
 answered on 24 Oct 2011
1 answer
114 views
Hi

I am trying the RadScheduler for ASP.NET AJAX.

Scheduler displays the appointments correctly, however, I am receiving an 404 error from a WebResource request.

I managed to decrypt the request parameters and found that it says:

pTelerik.Web.UI.Skins|Telerik.Web.UI.Skins.Office2010Blue.Scheduler.rsAppointmentBg.png

Anybody has a clue how can this 404 error be corrected?

Regards
Arian
Shinu
Top achievements
Rank 2
 answered on 24 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?