Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
136 views
Hello,

I need to set ClickToOpen behavior on Server Side. RadMenuItem doesn't have corresponding property. How can I do this?

Thank you
virt
Top achievements
Rank 1
 answered on 13 Jan 2010
2 answers
150 views
Hi all:

I have an ASP.NET application with several RadGrids on it displaying data, as well as some other text and images. All of the content is contained within an ASP.NET Ajax tabcontainer. The end user wants the ability to export all of the data to a PDF file, so I thought it might be a good idea to put a RadEditor on another tab, and have all of the data from the application added to the RadEditor content area, and then when the end user is ready they can make any needed changes in the RadEditor, and then use the ExportToPDF function to get the PDF.

However, I have been unable to get the data from the RadGrids into the RadEditor, can anyone give me some insight as to how I can accomplish this? I tried this:

public string RenderControl(Control ctrl)

  {

    StringBuilder sb = new StringBuilder();

    StringWriter tw = new StringWriter(sb);

    HtmlTextWriter hw = new HtmlTextWriter(tw);

 

    ctrl.RenderControl(hw);

    return sb.ToString();

  }

protected void Button1_Click1(object sender, EventArgs e)

  {

    RadEditor1.Content += RenderControl(RadGrid1);
    RadEditor1.ExportToPdf();
  }

But I got some kind of script error:

Script control 'RadGrid1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl

Any and all input is greatly appreciated.

John.

John
Top achievements
Rank 1
 answered on 13 Jan 2010
5 answers
124 views
Hi,

All my nodes are set to serverside callback. I get the following error intermittently when I drop a node onto another:  'this._backupExpandedNodes[...]' is null or not an object

function insertOver(destinationNode, sourceNode)
{
    var allnodes = destinationNode.get_nodes();
    allnodes.add(sourceNode);
 }

I've copied the drag and drop functionality from the samples. But added this function so that I can sort the nodes afterwards.

it's the allnodes.add(sourceNode); line which causes the error. Stack trace:

Telerik.Web.UI.ControlItemCollection.prototype={add:function(_ef){
var _f0=this._array.length;
this.insert(_f0,_ef);
},insert:function(_f1,_f2){
var _f3=_f2.get_parent();
var _f4=this._parent._getControl();
if(_f3){
_f3._getChildren().remove(_f2);
}
 calls:
Telerik.Web.UI.ControlItemCollection.prototype={add:function(_ef){
var _f0=this._array.length;
this.insert(_f0,_ef);
},insert:function(_f1,_f2){
var _f3=_f2.get_parent();
var _f4=this._parent._getControl();
if(_f3){
_f3._getChildren().remove(_f2);
}
if(_f4){
_f4._childInserting(_f1,_f2,this._parent);
}
Array.insert(this._array,_f1,_f2);
_f2.set_parent(this._parent);
if(_f4){
_f4._childInserted(_f1,_f2,this._parent);
_f4._logInserted(_f2);
}
calls:
childInserted:function(_1f8,node,_1fa){
if(!_1fa._childControlsCreated){
return;
}
this._restoreClientState();
if(this._threeState){
node._updateParentCheckState(this);
}
calls:
backupClientState:function(){
this._backupCollapsedNodes=this._getCollapsedNodes();
this._backupExpandedNodes=this._getExpandedNodes();
this._backupSelectedNodes=this.get_selectedNodes();
this._backupCheckedNodes=this.get_checkedNodes();
},_restoreClientState:function(){
this._clientState.selectedNodes=[];
for(var i=0;i<this._backupSelectedNodes.length;i++){
Array.add(this._clientState.selectedNodes,this._backupSelectedNodes[i]._getHierarchicalIndex());
}
this._clientState.collapsedNodes=[];
for(var i=0;i<this._backupCollapsedNodes.length;i++){
Array.add(this._clientState.collapsedNodes,this._backupCollapsedNodes[i]._getHierarchicalIndex());
}
this._clientState.expandedNodes=[];
for(var i=0;i<this._backupExpandedNodes.length;i++){
Array.add(this._clientState.expandedNodes,this._backupExpandedNodes[i]._getHierarchicalIndex());
}
this._clientState.checkedNodes=[];
for(var i=0;i<this._backupCheckedNodes.length;i++){
Array.add(this._clientState.checkedNodes,this._backupCheckedNodes[i]._getHierarchicalIndex());
}


Jaffar Sadiq
Top achievements
Rank 1
 answered on 13 Jan 2010
2 answers
108 views
I've a DIV control with an HtmlImage control inside dinamically generated by setting the src to a  an aspx page producing a Bitmap as

Response.OutputStream

.
Each time I press the btnVisualizza_MG button the image must be updated. The button is enclosed in a RadAjaxManager as triggering control of the div. This is a brief extract of the code.

 

<

 

telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">

 

 

 

 

 

    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnVisualizza_MG">

 

 

 

 

            <

 

UpdatedControls>

 

 

 

 

 

                <telerik:AjaxUpdatedControl ControlID="divDisegnoModificaDisegno" LoadingPanelID="lp1" />  

 

 

            </UpdatedControls>

 

 

 

 

 

        </telerik:AjaxSetting>

 

 

 

    <AjaxSettings>
</telerik:RadAjaxManagerProxy >

protected

 

void btnVisualizza_MG_Click(object sender, EventArgs e)

 

{

    divDisegnoModificaDisegno.Controls.Clear();

    System.Web.UI.HtmlControls.

HtmlImage image = new System.Web.UI.HtmlControls.HtmlImage();

 

    image.Src =

"DrawGeometriaSistema.aspx?dim_x=640&dim_y=609";

 

    divDisegnoModificaDisegno.Controls.Add(image);

}

THE PROBLEM: the first time I press the btnVisualizza_MG button, the DrawGeometriaSistema.aspx page is called and the image is generated but the following times the image remains unchanged since the code, when reaching "image.Scr=..." instruction, does not call the DrawGeometriaSistema.aspx page.

Why and how to solve this problem? 

Marco Miccini
Top achievements
Rank 1
 answered on 13 Jan 2010
6 answers
364 views
Hi all,

I am using the latest build and service pack of RC for ajax, and using a grid. I am using custom export buttons to export to pdf, excel and word. Excel and Word work, no problem. The pdf does not work unless i set the ignore paging=true, otherwise I receive a blank page.

I am using advancing sorting/paging with the needdatasource event. The grid functions perfectly in all respects except for the export to pdf.

Any help is much appreciated.

P.S. - as a side note, the grid is ajaxified, although the export buttons are not, although I do not think that has anything to do with it considering it works for Word and Excel in all cases.
Daniel
Telerik team
 answered on 13 Jan 2010
1 answer
148 views
I have a RadAjaxManager on my master page with the setting UpdatePanelRenderMode="Inline". On my pages I add the RadAjaxManagerProxy control and set the AjaxUpdatedControl's setting UpdatePanelRenderMode="Block". So it looks something like this:

Master:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline" 
        DefaultLoadingPanelID="LoadingPanel1"> 
        <ClientEvents OnRequestStart="DisableControls" OnResponseEnd="EnableControls" /> 
    </telerik:RadAjaxManager> 

Page:
<telerik:RadAjaxManagerProxy ID="ajProxyManager" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="ddlListing"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="divBedroomSuite" UpdatePanelRenderMode="Block" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 

So the issue I'm having here is that the UpdatePanelRenderMode setting of my updated control is not taking precedence over the RadAjaxManager's global setting. It keeps rendering the control as inline instead of as a block.

Is this some sort of bug with the control or is it something I just can't do with the control?

Thanks.
Dimo
Telerik team
 answered on 13 Jan 2010
1 answer
117 views
Hi,
I would like to create a grid with multi-level header. I saw many posts on this with suggested approach shown below.
http://www.telerik.com/help/aspnet-ajax/grdcustomizewithgridtemplatecolumn.html
Is this still the approach Telerik recommends? Using <TR>s and <TD>s to make the table, looks slightly cumbersome - especially when we have to build this grid on the fly - adding various header level features - sorting for instance.

Thanks for your reply in advance.

RN
Pavlina
Telerik team
 answered on 13 Jan 2010
3 answers
143 views
Hello,

I am trying to get clicks on tree view to load WebSuerControls to display new information, rather than loading the whiole page. I managed to do this without treeview using simple buttons, but cannot get it to work in treeview.

The code is as follows:

<div class="column first" id=""> 
                <telerik:RadTreeView ID="RadTreeView1" Runat="server"> 
                    <Nodes> 
                        <telerik:RadTreeNode runat="server" Text="Root RadTreeNode1"> 
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Text="Load WebUserControl1.ascx" OnClick="Button1_Click" ID="Button1" > 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" Text="Load WebUserControl2.ascx" OnClick="Button2_Click" ID="Button2"> 
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2"> 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" Text="Root RadTreeNode3"> 
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1"> 
                                </telerik:RadTreeNode> 
                                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2"> 
                                </telerik:RadTreeNode> 
                                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 3"> 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                        <telerik:RadTreeNode runat="server" Text="Root RadTreeNode4"> 
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1"> 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                    </Nodes> 
                </telerik:RadTreeView> 
                <br /> 
                 
                <asp:Button ID="Button3" runat="server" Text="Load WebUserControl1.ascx" OnClick="Button1_Click" /> 
<asp:Button ID="Button4" runat="server" Text="Load WebUserControl2.ascx" OnClick="Button2_Click" /> 
 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
   <AjaxSettings> 
       <telerik:AjaxSetting AjaxControlID="Button1"> 
           <UpdatedControls> 
               <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
           </UpdatedControls> 
       </telerik:AjaxSetting> 
       <telerik:AjaxSetting AjaxControlID="Button2"> 
           <UpdatedControls> 
               <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
           </UpdatedControls> 
       </telerik:AjaxSetting> 
   </AjaxSettings> 
</telerik:RadAjaxManager> 
                
                 
        </div> 
        <div class="column last"> 
                <h3>Multivariate Data Analysis</h3> 
                <asp:Panel ID="Panel1" runat="server"> 
</asp:Panel> 
            </div> 

And code behind:

 
Partial Class InSite_test_Default 
    Inherits System.Web.UI.Page 
 
 
 
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load 
        If (Not Me.CurrentControl Is String.Empty) Then 
            Me.LoadMyUserControl(Me.CurrentControl, Panel1) 
        End If 
    End Sub 
 
    Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
        Me.LoadMyUserControl("WebUserControl1.ascx", Panel1) 
    End Sub 
 
    Protected Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 
        Me.LoadMyUserControl("WebUserControl2.ascx", Panel1) 
    End Sub 
 
    Private Property CurrentControl() As String 
        Get 
            Return IIf(Me.ViewState("CurrentControl") Is Nothing, String.Empty, Me.ViewState("CurrentControl")) 
        End Get 
        Set(ByVal Value As String) 
            Me.ViewState("CurrentControl") = Value 
        End Set 
    End Property 
 
    Private Sub LoadMyUserControl(ByVal controlName As String, ByVal parent As Control) 
        parent.Controls.Clear() 
        Dim MyControl As UserControl = Me.LoadControl(controlName) 
        Dim userControlID As String = controlName.Split(".")(0) 
        MyControl.ID = userControlID.Replace("/", "").Replace("~", "") 
        parent.Controls.Add(MyControl) 
        Me.CurrentControl = controlName 
    End Sub 
     
End Class 
 

Please help?

Tris.
Simon
Telerik team
 answered on 13 Jan 2010
2 answers
114 views
When the selected index changes on my RadComboBox, I need to populate various RadTextBoxes with data from the database.  I have a blank VB aspx page with code-behind waiting for a request object parameter containing the primary key in the page_load method, but it never arrives from my Javascript function:

function indexChanged(sender, args) {  
    var id = sender.get_text().trim();  
    $.get( 'User.aspx', { userid:id }, function(data) {  
        alert(data);  
    });  
} 

What am I doing wrong here?  What is the correct syntax to send a parameter from the client and receive data back in an asynchronous way?  This seems to be a very basic function, and yet I can find no help in the documentation.

Thanks,
Mark
Mark Galbreath
Top achievements
Rank 2
 answered on 13 Jan 2010
17 answers
254 views
Hi,

I was able to implement a custom TitlebarTemplate in my RadDock, but the problem is that I don't have the correct result when the page is loaded inside Internet Explorer, but it is correct in Firefox. I have attached the results from each browser.

What should I do so that Internet Explorer display it correctly? (I am using Internet Explorer 7)

Edit: With styling changes, I was able to display it correctly in Internet Explorer, but I have another problem. It displays my radio button, but I can't click or select them. I can only move the RadDock and the mouse cursor is a crossed arrows.

Thanks,
Paul

Pero
Telerik team
 answered on 13 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?