Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
88 views
Using .NET 3.5 and C#. Trying to invoke the insert mode in my RadGrid. I have a FormTemplate set up. From the main page I call a popup window from which an item is selected that will govern the defaults for a new row in my RadGrid. The popup closes as follows:

 

        function TemplateSelected2() {
            if (window.opener != null && window.opener.StartNewLineItem != null) {

                // Call the parent window function to create a new line item
                if (templateID != "") {
                    window.opener.StartNewLineItem(templateID);
                }
                window.close();
            }
        }

 

 

 

Back on the main form, StartNewLineItem is meant to invoke the insert mode of the RadGrid
 

    function StartNewLineItem(templateID) {
        alert("start new line item");
        alert(templateID);

        // Start a new line item

        var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        tableView.IsItemInserted = true;
        tableView.rebind();

        // Copy values from the selected template into the new line item
        // <TODO>
        alert("after insert mode");
    }

 

The code runs without error, but does not put the RadGrid in Insert mode.

Is there a particular setting needed besides setting IsItemInserted=true and calling rebind() ?

Thanks.


 

Tsvetoslav
Telerik team
 answered on 13 Jun 2011
0 answers
44 views
Can't reproduce the issue now, so deleting post.
Shira
Top achievements
Rank 1
 asked on 13 Jun 2011
3 answers
76 views
Hello,

I am having a lot of difficulties finding information on the client API for the TreeList control.
I kept reading threads where Telerik staff was replying that the client side API would come soon and be greatly improved etc.

I am trying to achieve something very "simple" and I honestly thought it would be native in such a control. I want to be able to get the datakey information of a dataitem on the double click event. I can get to the item itself, but then either I am missing something in the various documentations, or it is impossible.

Is there a way to, on the client side, get the datakey value of the selected item ? (Native or not)

My Telerik ASP.NET AJAX version: v.2011.1.315.35

Thank You,

Jerome Prunera-Usach
Iana Tsolova
Telerik team
 answered on 13 Jun 2011
2 answers
314 views
Hello,
I saw in the link below this code:

 

<asp:ImageButton ID="btnPrintAll" runat="server" ImageUrl = "~/Images/NewDesign/btn-print-selected-dasr.png" CssClass="top" OnClientClick="MyPrint(); return false;" />

 


<telerik:ReportViewer ID="ReportViewer1" runat="server" style="display

:none">

 


</
telerik:ReportViewer

 

>

 

 

http://www.telerik.com/help/reporting/faq-print-client.html


when i write this code i get an error : Unknown server tag 'telerik:ReportViewer'.
i tried to drag the control from the toolbox but it doesn't appear.

My goal is to print reports without opening them

it's very important for me,
thanks in advance.
Yoni
Top achievements
Rank 1
 answered on 13 Jun 2011
2 answers
137 views

 

 


Hi,

I have a scenario, where i need to show a confirm msg box, for user. i.e.

Please find the sample code for yout reference.

 

 <form id="form1" runat="server">  
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
</telerik:RadScriptManager> 
    <div> 
        <asp:Label ID="Label1" runat="server" ForeColor="Red" Visible="false"></asp:Label> 
      
        <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" 
            InputSize="34" Width="225px" ReadOnlyFileInputs="true" AllowedFileExtensions=".xls" 
            EnableFileInputSkinning="false">  
            <Localization Select="Browse" /> 
        </telerik:RadUpload> 
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" OnClientClick="window.confirm('This will replace the current file. Do you want to continue?');" /> 
    </div> 
    </form> 
c#
protected void Button1_Click(object sender, EventArgs e)  
    {  
        Label1.Visible = true;  
        if (RadUpload1.UploadedFiles.Count > 0)  
        {  
            //Code to save the file  
            Label1.Text = "File uploaded successfully";  
        }  
        else 
        {  
            Label1.Text = "Select a file to upload";  
        }  
    } 

With this the RadUpload1.UploadedFiles.Count is becoming zero. So i am unable to upload the file.

I know that Upload control has some drawbacks in order to maintain security.

Help me.

Thanks & Regards,
Sudhanva.

 

Qusay
Top achievements
Rank 1
 answered on 13 Jun 2011
1 answer
215 views
Hi All,

How do I sort the field list menu items?  It's appearing in the same order as the columns in the grid.  I have many columns that are hidden which means my list is large and needs sorted!

Thanks,
Jerry
Mira
Telerik team
 answered on 13 Jun 2011
7 answers
267 views

I have an evaluation version of the RadControls for ASP.NET AJAX v 2008.1.515.20

I have a simple page with a button that does a postback, and toggles a RadDock's Closed property.

The button is registered in the AjaxManager, and the updated controls is set to the RadDock itself.

After clicking the button several times to show / hide the RadDock, I get the following error:

Invalid JSON primitive:

Any help?

Here is the ASPX Markup:

<%

@ Page Language="C#" AutoEventWireup="true" Theme="Oracle" Codebehind="PopupTest.aspx.cs"

 

Inherits="PasWbApp.UserControls.PopupTest" %>

<%

@ Register Src="../UserControls/AsActivityPopup.ascx" TagName="AsActivityPopup"

 

TagPrefix="adminServerPas" %>

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<!

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 id="Head1" runat="server">

 

<title>Untitled Page</title>

</

head>

<

body style="background-color: #ffffff">

 

<form id="form1" runat="server">

 

<telerik:RadScriptManager ID="MasterScriptManager" runat="server">

 

<Scripts>

 

<asp:ScriptReference name="" Assembly="" Path="~/Lib/Java/ScrollToAnchor.js" />

 

</Scripts>

 

</telerik:RadScriptManager>

 

<telerik:RadAjaxManager ID="MasterAjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="MasterAjaxLoadingPanel"

 

ClientEvents-OnRequestStart="centerUpdatePanel();" RequestQueueSize="5">

 

<AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="PopupToggleButton">

 

<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="PopupWindow" />

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

</AjaxSettings>

 

</telerik:RadAjaxManager>

 

<telerik:RadStyleSheetManager ID="MasterStyleSheetManager" runat="server">

 

</telerik:RadStyleSheetManager>

 

<telerik:RadAjaxLoadingPanel ID="MasterAjaxLoadingPanel" runat="server" Height="100%"

 

Width="100%" IsSticky="true" BackColor="White">

 

<img id="MasterAjaxLoadingPanelImage" alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

 

style="border: 0px;" />

 

<div id="MasterAjaxLoadingPanelBackground">

 

</div>

 

</telerik:RadAjaxLoadingPanel>

 

<telerik:RadScriptBlock runat="server" ID="CenterLoadingPanelScriptBlock">

 

<script language="javascript" type="text/javascript">

 

function centerUpdatePanel()

{

centerElementOnScreen(document.getElementById(

'MasterAjaxLoadingPanelBackground'));

}

function centerElementOnScreen(element)

{

var scrollTop = document.body.scrollTop;

var scrollLeft = document.body.scrollLeft;

var viewPortHeight = document.body.clientHeight;

var viewPortWidth = document.body.clientWidth;

if (document.compatMode == "CSS1Compat")

{

viewPortHeight = document.documentElement.clientHeight;

viewPortWidth = document.documentElement.clientWidth;

scrollTop = document.documentElement.scrollTop;

scrollLeft = document.documentElement.scrollLeft;

}

var topOffset = Math.ceil(viewPortHeight/2 - element.offsetHeight/2);

var leftOffset = Math.ceil(viewPortWidth/2 - element.offsetWidth/2);

var top = scrollTop + topOffset - 40;

var left = scrollLeft + leftOffset - 70;

element.style.position =

"fixed";

element.style.zIndex = 30000;

// set the opacity...

 

element.style.opacity = .7;

element.style.filter =

'alpha(opacity=70)';

//element.style.top = top + "px";

 

//element.style.left = left + "px";

 

element.style.top = 0;

element.style.left = 0;

element.style.width = viewPortWidth;

element.style.height = viewPortHeight;

var imgElement = document.getElementById('MasterAjaxLoadingPanelImage');

imgElement.style.position =

"fixed";

imgElement.style.top = top +

"px";

imgElement.style.left = left +

"px";

imgElement.style.opacity = 1;

imgElement.style.filter =

'alpha(opacity=100)';

imgElement.style.zIndex = 40000;

}

</script>

 

</telerik:RadScriptBlock>

 

<div>

 

<asp:Button runat="server" ID="PopupToggleButton" Text="Toggle Popup" />

 

<br />

 

<telerik:RadDockLayout runat="server" ID="DockLayout">

 

<telerik:RadDock runat="server" ID="PopupWindow" DockMode="Floating" Pinned="false"

 

Closed="true" Collapsed="false" Height="520" Width="780">

 

<ContentTemplate>

 

Hello There!

</ContentTemplate>

 

</telerik:RadDock>

 

</telerik:RadDockLayout>

 

</div>

 

</form>

</

body>

</

html>

AND THE CODE BEHIND...

protected void Page_Load( object sender, EventArgs e ) {

this.PopupToggleButton.Click += new EventHandler( PopupToggleButton_Click );

}

protected void PopupToggleButton_Click( object sender, EventArgs e ) {

if( PopupWindow.Closed ) {

PopupWindow.Closed =

false;

}

else {

PopupWindow.Closed =

true;

}

}

Pero
Telerik team
 answered on 13 Jun 2011
7 answers
141 views
Hi,

I have the tree setup with 'drag and drop' and 'multiple select' enabled and it functions as expected except for one issue. The order of the multiple selected nodes are not preserved once dropped. Even whilst the nodes are in the process of being dragged, the order displayed in dragged nodes are different to what was originally selected. Then when dropped, they are sometimes a completely different order again.

There does not seem to be any kind of pattern of behavior as far as the order goes.

I have been using the radtreeview in a very large project for quite some time and have only just been made aware of this issue by one of our customers.

This is a large project integrated project so I can not post the code right now, but I will try and re-create the issue in a smaller project as an example in the meantime.

Has anyone else experienced this behavior, or better, know how to configure the treeview to preserve order during the drag and drop?

Thanks,
Dan K.
Dimitar Terziev
Telerik team
 answered on 13 Jun 2011
1 answer
215 views
I know there are examples that show how to add a confirmation popup to RadButton, and there are examples that show how to add a RadConfirm to a RadButton.  But what about RadButton with a RadConfirm in an AJAX scenario??  I'm using RadButton to ajaxify an ASP panel and I want a confirmation to happen before the server-side code fires, but I can't figure out how to make that happen.
Slav
Telerik team
 answered on 13 Jun 2011
3 answers
62 views
I have an issue where we are using the load on demand mode to retreive nodes on a tree expand.  The tree is hosted inside of a radcombobox.  Node expand works as expected as well as node selection.  However, when the combo closes we collapse the root node, clear it's nodes and set expand mode back to webservice so the webservice will be called again on future expands.

However, after doing this I want to set the selected node in the list of those returned from the webservice if I have a match.  The issue is I get an error "Line: 1185 Char 6 'undefined' is null of not an object.  In stepping into the telerik javascript it seems that a selected node is hanging around possibly but is not fully initialized.

Anyone have any ideas or seen anything like this?
Dimitar Terziev
Telerik team
 answered on 13 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?