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

What would cause program execution to keep switching between a Page_Load event and a RadAjaxManager_AjaxRequest event ? And sometimes even a function and a RadAjaxManager_AjaxRequest event?

I experience this when I try to debug my program, and as I am stepping through it, line execution keeps switching from one to the other. And not only that, after completing one round of switching between Page_Load and RadAjaxManager, the whole process is repeated not once, not twice, but at least 3-4 times.

Although I still get my desired results, without any noticeable delay, it sure is so much inefficient and very confusing to debug.

I would have wanted to paste my actual code but it is too big. I'm just wondering why this is happening and what should I consider doing so that the execution is more efficient and predictable.

Any feedback or help would be appreciated.

Thanks,
_______________
Virgil Rodriguez
Iana Tsolova
Telerik team
 answered on 12 Oct 2009
1 answer
163 views
Hi,

I have added a Radeditor control into my ascx page, but I am having problems with the toolbar functionality of the editor. The 2 buttons that I have included are the Bold and Bullet List buttons.

The Bold button seems to work ok, but I am having problems with the bullet list. It is a little hard to explain but this is what I am doing:-

In the rededitior (it is completely empty of text) I type some plain text into the editor. (this is fine) On the very next line I want to add a buttet list, so after my text I press the return key on my keyboard (ok so far) Now I click on the bullet list button on the editors toolbar, but nothing appears to happen and the cursor disappears.

As an alternative, I type a list of plain text of the items that I want in the bullet list, I then highlight the items and click on the Bullet list. This creates the list ok, but it jumps down 2 lines before the bullet list starts.

I hope this makes some sence!
Am I just trying to use the bullet list in the wrong way or is there something wrong? Can I restrict how many lines that the bullet list drops down before it is shown in the editor?

Regards

Gary

Rumen
Telerik team
 answered on 12 Oct 2009
1 answer
175 views
Hi Support,

I was trying the example of combobox load on demand.
However, i get a Javascript alert message when there is no match found instead of "No Match found" message under the combobox. How can I fix this? I have tried latest version and also latest internal build

Screencap:
http://www.ximnet.com.my/telerik_support_screens/combobox%20demand%20search.png
Simon
Telerik team
 answered on 12 Oct 2009
1 answer
341 views
Hi Telerik !

Iam using the RAD FILE EXPLORER control in my project. I have added the CUSTOM BUTTON on to the RADTOOLBAR & named "ARCHIVE " . As result of which it gets appeared on to both the

a. TREE VIEW
b. GRID CONTEXT VIEW

Now what I want to do is to get the path of the folder or file of the selected ITEM(folder/file) in javascript , so that I can ARCHIVE the selected folder/file.

Presently, iam getting the FILE name using javascript function but Im not getting the FULL PATH where that particular file is located.

Please help me to solve the problem.

Iam using the below mentioned code in my file :-

<asp:Content ID="Content1" ContentPlaceHolderID="MasterContentPlaceHolder" runat="Server">  
 
    <script language="javascript" type="text/javascript">  
 
        function OnClientFileOpen(oExplorer, args) {  
            var item = args.get_item();  
            var fileExtension = item.get_extension();  
            // File is a image document, do not open a new window  
            args.set_cancel(true);  
 
            // Tell browser to open file directly  
            var requestImage = "FileSystemHandler.ashx?path=" + item.get_url();  
            document.location = requestImage;  
            //}  
        }  
 
 
        function toolbarClicked(toolbar, args) {  
            debugger  
            var buttonValue = args.get_item().get_value();  
            if (buttonValue == "Archive")  
                DoPostBack();  
        }  
 
        function gridContextMenuClicked(toolbar, args) {  
            debugger  
            var buttonValue = args.get_item().get_value();  
            //var filename = args._targetElement.childNodes[0].nodeValue;  
            //var test = filename;  
            //var buttontext = args.get_node().get_contextMenu().get_selectedValue();  
            if (buttonValue == "Archive") {  
                DoPostBack();  
            }  
 
            //var filelocation = "Z:\testdmsdocs\SharedDocuments" + filename.get_url();  
            //document.location = filelocation;  
                         
                  
              
        }  
 
        function treeContextMenuClicked(toolbar, args) {  
            debugger  
            var buttonValue = args.get_menuItem().get_value();  
            if (buttonValue == "custom_Menu")  
                DoPostBack();  
        }  
 
        function DoPostBack() {  
            __doPostBack('Archive', 'Archive');  
        }  
 
        function attachHandlers(explorer, args) {  
             
            var toolbar = explorer.get_toolbar();  
            toolbar.add_buttonClicked(toolbarClicked);  
            //support for tree context menu  
            var tree = explorer.get_tree();  
            tree.add_contextMenuItemClicked(treeContextMenuClicked);  
            //support for grid context menu  
            var gridContextMenu = explorer.get_gridContextMenu();  
            gridContextMenu.add_itemClicked(gridContextMenuClicked);  
        }  
 
        function OnClientDelete(oExplorer, args) {  
 
            var isRoot = isRootDir(oExplorer.get_tree(), args.get_path());  
            // Check whether the moved item is a directorty and whether it is the root directory;  
            if (args.get_item().isDirectory() && isRoot) {  
                alert("You cannot delete the root directory");  
                args.set_cancel(true);  
            }  
 
        }  
 
        function OnClientMove(oExplorer, args) {  
 
            var isRoot = isRootDir(oExplorer.get_tree(), args.get_path());  
            // Check whether the moved item is a directorty and whether it is the root directory;  
            if (args.get_item().isDirectory() && isRoot) {  
                // Check whether this is a renaming ;  
                if (isRenaming(args.get_newPath())) {// The renaming operation ;  
                    alert("You cannot rename the root directory");  
                    args.set_cancel(true);  
                }  
            }  
        }  
 
        function isRootDir(oTree, path) {  
            var dirForDelete = oTree.findNodeByValue(path);  
 
            if (dirForDelete != null) {  
                return dirForDelete.get_level() == 0;  
            }  
            // Will occurs only when the "path" parameter is not a valid folder path.  
            else return false  
        }  
 
        function isRenaming(destPath) {  
            if (destPath.search("/\//") == -1) {  
                return true;  
            }  
            else {  
                return false;  
            }  
        }  
       
    </script> 
 
    <style type="text/css">  
        .test_button span span span span  
        {  
            background-image: none !important;  
            padding-left: 2px !important;  
            border: solid 1px grey;  
        }  
    </style> 
    <table width="100%">  
        <tr> 
            <td> 
                <%-- <div id="eventConsole" style="height: 470px; width: 300px; overflow: auto; display:none;">  
                </div>--%> 
                <telerik:RadFileExplorer runat="server" ID="DocumentsRadFileExplorer" Width="734px" 
                    Height="400px" VisibleControls="All" EnableCreateNewFolder="true" EnableCopy="true" 
                    EnableOpenFile="true" OnClientMove="OnClientMove" OnClientDelete="OnClientDelete" 
                    OnClientLoad="attachHandlers"    
                    OnClientFileOpen="OnClientFileOpen"   
                    ongridpopulated="DocumentsRadFileExplorer_GridPopulated">  
                    <Configuration SearchPatterns="*.*" MaxUploadFileSize="10485760"></Configuration> 
                </telerik:RadFileExplorer> 
            </td> 
        </tr> 
    </table> 
</asp:Content> 
 
While the  method that Iam using in my FILESYSTEM.CS file is shown below as :-

public static string ArchiveFolder(string path)  
    {  
        string NewFile_Name = "";  
        string File_Path = "";  
        Glb_Entities.ExecuteSP(new object[] {"Usp_Dms_ArchiveFile"          
            ,"File_Name", path.Substring( path.LastIndexOf("/")+1)  
            ,"NewFile_Name", NewFile_Name  
            ,"File_Path", File_Path  
            ,"File_ArchivedBy", HttpContext.Current.Session["UserID"].ToString()  
            });  
        return string.Empty;  
 
    } 
It would be my pleasure if you please help me try to solve my problem.

Thanks

Ajay
Fiko
Telerik team
 answered on 12 Oct 2009
5 answers
207 views
Hi there,

im trying to add a css class to my pager style but it always just reverts to the orginal GridPager_Default.

here is my code:

<telerik:RadGrid ID="grdProperties" runat="server" GridLines="None" AllowPaging="True" 
                                            AllowSorting="True" AutoGenerateColumns="False" PageSize="3" OnNeedDataSource="grdProperties_NeedDataSource" 
                                            OnItemDataBound="grdProperties_ItemDataBound" EnableEmbeddedSkins="false">  
                                            <PagerStyle ShowPagerText="false" VerticalAlign="Middle" ForeColor="White" CssClass="ProfilePager_Default" Mode="NextPrevAndNumeric" EnableSEOPaging="True" PrevPageImageUrl="/surf4property/images/btnPrevious.png" NextPageImageUrl="/surf4property/images/btnNext.png"></PagerStyle> 
 
                                            <MasterTableView NoMasterRecordsText="No Properties to display">  
 
Number of columns.....  
 
</Columns> 
                                                <RowIndicatorColumn Visible="False">  
                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                </RowIndicatorColumn> 
                                                <ExpandCollapseColumn Visible="False" Resizable="False">  
                                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                                </ExpandCollapseColumn> 
                                                <EditFormSettings> 
                                                    <PopUpSettings ScrollBars="None"></PopUpSettings> 
                                                </EditFormSettings> 
                                            </MasterTableView> 
                                        </telerik:RadGrid> 

In the above example i try to create a new CSSClass but it doesnt work? it keeps using the original GridPager_Default
Sebastian
Telerik team
 answered on 12 Oct 2009
4 answers
229 views
How do I reference the NavigateURL property on a toolbar button.

I can change manipulate several properties such as:

me.toolbar1.items(1).text = "click me"
me.toolbar1.items(1).enabled = true

I cannot see how to get a handle on the URL value, which I need to update with query string values that are read at runtime from a database.

(p.s. assume I have less than one day experience with the toolbar control)
Veselin Vasilev
Telerik team
 answered on 12 Oct 2009
5 answers
205 views
Hello,

I had a linkbutton (to print) for each row in the master table and whenever the linkbutton is clicked the details table records needs to be printed.

Currently I am able to export the details table contents to excel (I had a linkbutton similar to print on each row for exporting). apart from the export I also need the functionality to print the contents of the details table.

Any ideas on this??

Help would be greatly appreciated.

Thanks,
Kevin
Daniel
Telerik team
 answered on 12 Oct 2009
2 answers
149 views
I just wantto find a RadNumericTextBox that resides in a FormView as follows:

function

kontrol() {

 

alert(

"asd")

 

 

 

var txtmiktar = window["<%= RadNumericTextBox2.ClientID %>"];

 

 

var txtyuzde = window["<%= RadNumericTextBox1.ClientID %>"];

 

 

if (txtmiktar.GetValue() == '') {

 

txtmiktar.SetValue(0.00) ;

}

 

if (txtyuzde.GetValue() == '') {

 

txtyuzde.SetValue(0.00) ;

}

 

if (txtyuzde.GetValue() == 0 && txtmiktar.GetValue() == 0) {

 

alert('

asd');

 

 

}

}

And i call it this way: However it throws exception : cs0103 'RadNumericTextBox2'  does not exist in the current context

 

<

telerik:RadNumericTextBox ID="RadNumericTextBox2" Runat="server"

 

 

Culture="asd" DbValue='<%# Bind("asd") %>' Type="Currency"

 

 

Width="125px" CssClass="label2" MaxValue="1E+16" MinValue="-1E+16" >

 

 

 

 

 

<ClientEvents OnKeyPress="kontrol" />

 

 

</telerik:RadNumericTextBox>

Thanks...

 

Kem Arda
Top achievements
Rank 1
 answered on 12 Oct 2009
1 answer
108 views
Hi, can anybody see/explain what I'm doing wrong here? Or let me know a better way to do this. I've tried several approaches, not just the one shown here, but all approaches turn up the same problem.

I have a tree with several levels. I want to remove some nodes from a given level, but leave others: i.e. selectively remove nodes based on their values, all client-side javascript. If I do this:

   var t = $find(ClientID_RadTree1);
   var p = t.findNodeByValue(""); // gets parent node
   for (var i=0; i<p.get_nodes().get_count();i++)   
   {         
       var node = p.get_nodes().getNode(i);         
       console.log(node.get_text());
       if (node.get_value() != '1') p.get_nodes().remove(node);   // only leave the node with value='1'
   }

I have to run in THREE times to get the intended results. Apparently, the node indexes are being changed upon each "remove" call, or something similar.

Any  tips (or source code for the TreeView Javascript)?

Thanks!
R


Veselin Vasilev
Telerik team
 answered on 12 Oct 2009
4 answers
111 views
Hello,

While going through the RadComboBox Entity DataSource Demo I noticed that when an item is selected in RadComboBox2 the paging option does not actually scroll through the next 10 items. When the icon is clicked to advance to the next 10 items, the Combobox appears to be advancing to the next 10; however, the item that was selected originally is displayed at the top of the list and the message at the bottom changes from "Items 1-40 out of 92" to "Items 1-40 out of 1", the next 10 items do not become available either. Should this be happening or should the paging option still advance to the next 10 and update the message to say "Items 1-50 out of 92"?

Thanks,
Casey
Simon
Telerik team
 answered on 12 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?