Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
87 views
Hi,

I have this piece of code:



<script type="text/javascript">
 
 
       function setEmpty()
        {
            var combo = $find("<%= combo1.ClientID %>");
            combo.clearselection(); 
            combo.set_emptyMessage("select please"); 
        }
 
 
        function nodeClicking(sender, args) {
            var comboBox = $find("<%= combo1.ClientID %>");
 
            var node = args.get_node()
            comboBox.set_text(node.get_text());
 
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).set_text(node.get_text());
            comboBox.get_items().getItem(0).set_value(node.get_value());
 
            comboBox.commitChanges();
 
            comboBox.hideDropDown();
 
            // Call comboBox.attachDropDown if:
            // 1) The RadComboBox is inside an AJAX panel.
            // 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
            // Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.
 
            //comboBox.attachDropDown();
        }
 
        function StopPropagation(e) {
            if (!e) {
                e = window.event;
            }
 
            e.cancelBubble = true;
        }
 
        function OnClientDropDownOpenedHandler(sender, eventArgs) {
            var tree = sender.get_items().getItem(0).findControl("rvt1");
            var selectedNode = tree.get_selectedNode();
            if (selectedNode) {
                selectedNode.scrollIntoView();
            }
        }
    </script>
 
 
<telerik:RadComboBox ID="combo1" runat="server" CausesValidation="false"
    EnableEmbeddedSkins="false" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
    EmptyMessage="select please" MaxHeight="200px"  ShowToggleImage="True" 
 
    Width="50%" AllowCustomText="True">
    <ItemTemplate>
        <div id="div1">
            <telerik:RadTreeView ID="rvt1" runat="server" Width="100%" Height="250px"
                DataSourceID="ds1" DataFieldID="ID" DataValueField="ID"
                DataFieldParentID="ParentID" DataTextField="Name" OnClientNodeClicking="nodeClicking" >
                <DataBindings>
                    <telerik:RadTreeNodeBinding Expanded="true" />
                </DataBindings>
            </telerik:RadTreeView>
        </div>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem Text="" />
    </Items>
</telerik:RadComboBox>
<asp:ObjectDataSource ID="ds2" runat="server"
    EnablePaging="True" OnSelecting="dds2_Selecting"
    SelectMethod="GetList" TypeName="BLL">
    <SelectParameters>
        <asp:Parameter Name="p1" Type="Int32" />
        <asp:Parameter Name="p2" Type="Int32" />
        <asp:Parameter Name="p3" Type="Boolean"  DefaultValue="True" />
    </SelectParameters>
</asp:ObjectDataSource>



The combobox is inside a panel. When I show the panel, I call the function setEmpty() to clear the previous data. The problem is that I get a javascript exception. Debugging, I realize that the that the find("<%combo1.ClientID %>"); is returning null... ie it is not able to find the combo1.ClientID. The strange thing is that the function nodeClicking is working, ie, when I click in a node, the nodeClicking function is properly executed... The only problem is with tje setEmpty() function.


Gimmik
Top achievements
Rank 1
 answered on 25 May 2011
1 answer
74 views
Hello,

In our application, we have a scenario where we need to handle multiple ajax postbacks executing in parallel. We have set "RequestQueueSize" of the Ajax Manager to 10 to accomplish this,

After doing so, We found a problem when we tested the scenario outlined below :

We have 2 combos(Say combo1 and combo2) on a page, both of which cause postbacks to populate different fields . We executed the following steps:

1. choose a value in combo1. Combo 1 posts back to fetch and populate related values on our page
2. change the selected value in combo1. While its postback is executing, choose a value in combo2.

On doing this we found both postbacks execute successfully. But After combo2's postback finishes executing, the state of combo1 is restored to what it was after step1 above.

Any help with solving this problem would be greatly appreciated.
Thank you
Maria Ilieva
Telerik team
 answered on 25 May 2011
1 answer
424 views
Hello,

I have an empty PanelBar in my aspx page and I want to fill it in the code behind.
I successfully fill the PanelBar with PanelItems but I don't understand how to build th HeaderTemplate and Contentemplate.
This work :
RadPanelItem myPanelItem = new RadPanelItem("First item")
myPanelBar.Items.Add(myPanelItem);

But when I try to add the headerTemplate like that :
RadPanelItem myPanelItem = new RadPanelItem("First item")
 
Button btn = new Button();
btn.Text = "Test";
myPanelItem.Header.Controls.Add(btn);
 
myPanelBar.Items.Add(myPanelItem);


Visual studio say that the Header is null and the header can't be instanciate.

So I try others way but nothing successfull
Is someone has any solution ?
Kalina
Telerik team
 answered on 25 May 2011
2 answers
390 views
Hi,

My problem is very simple. When I deleted a user from my grid, I want to call radConfirm (from RadAjaxManager) from the serverside and send some info to the callback js function, but I don't know how to pass variables into the radConfirm. I found this trick, but it only work if my radConfirm call come from a Js function, Like I said, my call come from the serverside. So, I tried to call a Js function from the serverside with the following code :

             string script = "<script language='javascript'> " +       
                                   "    jsFunction(" + myVar + ");" +
                                   "</script>";  
            
            Page.ClientScript.RegisterStartupScript(this.GetType(), "script ", script );

This seem to work, except that if I make a Telerik instruction in the jsFunction (like radconfirm), it doesn't work (Chrome's java
console said that I can't call radConfirm from undefined). 


So, may someone help me? How may I do it ?
Thank you

David
David
Top achievements
Rank 1
 answered on 25 May 2011
3 answers
446 views
Hi,
Whenever we set ShowExportToExcel/Csv/Pdf = true, in the command item settings, the buttons are displayed right corner, in my case top-right corner. I want to place the buttons on the top-left corner of the grid. Is there a way to achieve this?

Thanks.
Daniel
Telerik team
 answered on 25 May 2011
1 answer
89 views
I don´t know how long it will be available, but this is the most challenging #captcha I´ve ever found: http://bit.ly/votaxpiki

I figured it out the third time. Its really hard.
Pero
Telerik team
 answered on 25 May 2011
1 answer
111 views
Hello

I have deployed my asp.net 2 application that i developed in a 32bit environment to a 64 bit server.
IIS 7(Windows WebServer 2008 R2)

It worked fine until i set my application pool to enable 32bit applications to true, all telerik controls are now rendering incorrectly 
eg. The RadMenu is not rendering its children and the RadTabStrip isn't displaying

Regards
Kate
Telerik team
 answered on 25 May 2011
11 answers
196 views
I have a form inside a RadAjaxUpdatePanel, the form uses a custom buttom to preview data from the form. It does this using a javascript onclick event that is defined in a .js class in the custom project ( seperate from the form).  the .js file is registered like so:
 
            ClientScriptManager cs = this.Page.ClientScript;  
            Type rsType = this.GetType();  
            cs.RegisterClientScriptInclude("JobScript", cs.GetWebResourceUrl(rsType, "CareerCenter_Classes.JsScripts.Jobs.js"));  
 

The page shows that the script is registered (using IsClientScriptIncludeRegistered), However when I try to use the button, I get a javascript error "object expected".

I know the javascript code works, It only broke when I tried to ajax the page. does anyone know what I can do to fix this?
Radoslav Georgiev
Telerik team
 answered on 25 May 2011
1 answer
117 views
Hi, im using dynamic columns via pivots in my sql code..and binding those columns in my radgrid

how do i get totals for 'some' columns left to right and the total displayed into a new column name(total) and also getting totals top to bottom and displayed into a footer 

Thanks!
Pavlina
Telerik team
 answered on 25 May 2011
1 answer
148 views

Hi there

I am having issues with using the RadAjaxManager and the client events. I can only use the following 2:

OnRequestStart and OnResponseEnd

<telerik:RadAjaxManager ID="RadAjaxManager" runat ="server">
<
ClientEvents
OnRequestStart="startRequest" OnResponseEnd="endResponse">
</
telerik:RadAjaxManager
>

I need to use the following ClientEvents but they don't appear:

OnRequestSent and OnResponseReceived

Issue that is occuring is that upon an error occuring within the build and an exception being thrown doesn't invoke the OnResponseEnd="endResponse" and thus my function endResponse doesn't run


function endResponse(sender, eventArgs)
{
parent.enableTabs();
}

So I would like to use the onResponseRecieved so that even if an exception is thrown onResponseRecieved will still run a function

<
telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
<ClientEvents OnRequestStart="startRequest" OnResponseEnd="endResponse" OnResponseReceived="receiveResponse"/>
</telerik:RadAjaxManager >

function receiveResponse(sender, eventArgs)
{
parent.enableTabs();
}

I was wondering if it could be down to the Telerik.Web.UI.dll we are using as version is 2009.02.0826.20

Any responses or help are greatly appreciated!

Cori
Top achievements
Rank 2
 answered on 25 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?