Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
265 views
I'm trying to open a RadWindow from a RadGrid in a web user control from server-side code using the RadAjaxManager in my Master Page (this is .NET 2 and VS2005).  In the ItemCommand event of my RadGrid I'm calling the following line of code:

RadAjaxManager

.GetCurrent(this.Page).ResponseScripts.Add("radopen(null,\"dlgTest\");");

The first time I run it I get the following error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received From the server could not be, parsed. Common causes for this error are when the response is modiFied by calls to Response.WriteO, response filters, HttpModules, or server trace is enabled  

Details: Error parsing near 'play:none;”>/span>|<html>

<head>

'.

Every time I select a row in the grid after cancelling this message, the dialog will load but the data does not change after the first time it loads.

Does anyone have any suggestions or sample of how I could do this?  Following is a link to a test project where I've been able to reproduce the problem:
  http://sites.google.com/site/pbbgso/Home/TelerikGridTest.zip?attredirects=0
Just click on one of the link buttons in the grid to get the error.  This is where I'd like to launch the window.

 

 

 

 

 

Paul Bishop
Top achievements
Rank 1
 answered on 19 Jan 2009
1 answer
152 views
I have a grid that returns the following records, and I am trying to show the total #l logons in the footer.  However, all I get is the footer text, without the summed value.  I have tried various combinations with using footertext and footeraggregateformatstring without any better results.

January, 2009  51
December, 2008  93
July, 2008  33
June, 2008  4
March, 2008  9
February, 2008  46
January, 2008  44
December, 2007  45
November, 2007  70
October, 2007  111
September, 2007  104
August, 2007  33
July, 2007  4

My grid definition looks like:

 
<telerik:RadGrid ID="gridSummary" runat="server" AutoGenerateColumns="False"   
        GridLines="None" ShowFooter="True" Skin="WebBlue" Width="300px">  
        <HeaderContextMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200">  
            </CollapseAnimation> 
        </HeaderContextMenu> 
        <HeaderStyle Width="150px" /> 
        <MasterTableView> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="yr,mo"   
                    DataNavigateUrlFormatString="usagedata.aspx?typ=detail&amp;yr={0}&amp;mo={1}"   
                    DataTextField="periodname" UniqueName="period">  
                    <HeaderStyle HorizontalAlign="Right" /> 
                    <ItemStyle HorizontalAlign="Right" /> 
                </telerik:GridHyperLinkColumn> 
                <telerik:GridNumericColumn DataField="logons" Aggregate="Sum" 
                    FooterAggregateFormatString="{0} total logons" HeaderText="# of Logons"   
                    NumericType="Number" UniqueName="logons1">  
                </telerik:GridNumericColumn> 
            </Columns> 
        </MasterTableView> 
        <FilterMenu EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200">  
            </CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid> 

 


Thanks!
Steve
Steve LaForge
Top achievements
Rank 1
 answered on 19 Jan 2009
4 answers
101 views
Hello,

I hope you're all enjoying the holidays.  Here's a quick scenario describing my situation.  Everything uses AJAX.

I have a grid on a page that is filled with some data.  I have a GridTemplateColumn in the grid that contains some custom LinkButton controls.  Upon clicking a LinkButton, a server-side event is fired that calls the RadAjaxManager1.Redirect() method to take me to another page.  However, I've noticed that when I click the LinkButton, the grid goes into a "Loading" mode, comes out of this "Loading" mode (so that I can again see the contents of the grid), and THEN the browser redirects.  Everything is working as it should, but I have a need to either a) keep the grid in the "Loading" mode while the browser performs the redirect or b) redirect the browser right away without the grid ever entering this "Loading" mode.

Does that make sense?  I'd appreciate any help you can offer.

Thank you,

Eric Skaggs
Eric Skaggs
Top achievements
Rank 2
 answered on 19 Jan 2009
2 answers
325 views
I am new to these controls and still evaluating them.  I cant seem to figure something out that I really want to happen and was hoping someone here could point me in the right direction.

I have a grid that lists just a few columns from a table. When the user selects a row I want to display a formView control with all of the remaining columns and allow them to edit, delete, etc...

I have all of that working using a <NestedViewTemplate>

However, it seems that clicking the row to select it does nothing, I have to resort to clicking the expand/collapse button on the left.
                 
Is there a way to eliminate the expand/collapse button all together and make that happen on row click (select)?

If not, is there a way to change my expand collapse button?  I have changed the Button Type in the MasterTableView.ExpandCollapseColumn property a million times and nothing takes affect...???

Shawn
Top achievements
Rank 1
 answered on 19 Jan 2009
4 answers
172 views

Hi

I customized the editor tools with a config similar with the one below (only a little longer):

  <Tools>
<telerik:EditorToolGroup DockingZone="Bottom" >
<telerik:EditorTool Name="AbsolutePosition" ShowIcon="true" />  
<telerik:EditorTool Name="TrackChangesDialog" Enabled="true" ShowIcon="true" />
</telerik:EditorToolGroup>
</Tools>

My problem is that I don't know how what are the settings to make the words and charater count visible and also

the html hierarchy (Ex: UL > LI > STRONG > EM > U > STRIKE > FONT > FONT > RemoveElement).

If I don't do any settings they are visible.

PS: telerik:EditorToolGroup DockingZone="Bottom" DockingZone attribute is not visible in the VS2005 designer.

I use VS2005 + telerik Q3 2008 (I'll update to 2009 as soon as I have some time ).

Bogdan
Top achievements
Rank 1
 answered on 19 Jan 2009
2 answers
170 views
Is there an example for creating and binding a radtooltip to another runtime created control?  I have used it before with success when statically defined, but I tried something simple today I thought should work and it does not.  Everything is in as expected in viewsource, but no popup.  This is called in page.preinit.  There are radnumerictextboxes in the previous cell of the same row, created within the same loop, that work perfectly fine.
 
    If Not IsDBNull(myreader("rollovertext")) Then 
                    Dim tooltip As New Telerik.Web.UI.RadToolTip 
                    Dim qimage As New System.Web.UI.WebControls.Image 
                    Dim imgname As String 
                    imgname = "img" & CStr(myreader("CalcOrderID")) 
                    With qimage 
                        .ImageUrl = CStr(myreader("ImgPath")) 
                        .ID = imgname 
                    End With 
                    With tooltip 
                        .ID = "tooltip" & CStr(myreader("CalcOrderID")) 
                        .TargetControlID = qimage.id 
                        .Text = CStr(myreader("rollovertext")) 
                        .Width = "150" 
                        .AutoCloseDelay = 10000 
                        .Skin = "Web20" 
                        .Position = ToolTipPosition.MiddleRight 
                        .OffsetY = 0 
                        .OffsetX = 10 
                        .ShowDelay = 300 
                    End With 
 
                    helpcell.Controls.Add(qimage) 
                    helpcell.Controls.Add(tooltip) 
                End If 



Viewsource shows this:

<img id="img2" src="images/qmark16.png" style="border-width:0px;" /><div id="tooltip2" style="display:none;"
                    <input id="tooltip2_ClientState" name="tooltip2_ClientState" type="hidden" /> 
 
 
Sys.Application.add_init(function() { 
    $create(Telerik.Web.UI.RadToolTip, {"autoCloseDelay":10000,"clientStateFieldID":"tooltip2_ClientState","formID":"form1","offsetX":10,"offsetY":0,"position":23,"showDelay":300,"skin":"Web20","targetControlID":"img2","text":"roll 3","width":"150px"}, null, null, $get("tooltip2")); 
}); 
 
 

Thank you for any insight you can provide.
Joel
Top achievements
Rank 2
 answered on 19 Jan 2009
10 answers
225 views
Hi,

Is there any way we can add tool tip or link  in RadComboBox .

In my situation ,when the user search ,if the value or information is not available, i need to show a link in Dropdown says 'Add New' ,when they click ,rad window or tooltip has to open.

Is there any way to achieve this behavior (ASP).

Thanks in Advance.
Eva


 
Eva
Top achievements
Rank 1
 answered on 19 Jan 2009
3 answers
345 views
I am auto-generating my columns, however I want to hide the "ID" column.  Can this be done without specifically defining the column ?
Liza
Top achievements
Rank 1
 answered on 19 Jan 2009
2 answers
181 views
I'm using the panelbar, and allow for a choice between two different views (which change the contents in the panelbar).

Changing the view recreates the panelbar, but the buttons in it now require two clicks.(complete_Click only gets called on the second click.).  To reproduce, set a breakpoint at complete_Click run the code, click on the "COMPLETE" button, verify that the breakpoint is hit with one click.  They click on the top "Completed courses", view the "new" panelbar, try clicking on "COMPLETE" and see it require two clicks to hit the breakpoint.

My test.aspx code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<%@ 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 runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">        
                 <asp:Button ID="newcourses" runat="server" Text="New Courses" onclick="newcourses_Click" />
                 <asp:Button ID="completedcourses" runat="server" Text="Completed Courses" onclick="completedcourses_Click" />
                 <asp:PlaceHolder ID="courseplaceholder" runat="server"></asp:PlaceHolder>
            </telerik:RadAjaxPanel>
    </div>
    </form>
</body>
</html>

My test.aspx.cs code

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
using System.Data.SqlClient;

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["current"] == null)
        {
            Session["current"] = "True";
        }
        createPanelBar();  
    }

    void createPanelBar()
    {
        courseplaceholder.Controls.Clear();

        RadPanelBar coursepanels = new RadPanelBar();
        coursepanels.ExpandMode = PanelBarExpandMode.SingleExpandedItem;
        coursepanels.Skin = "Telerik";

        RadPanelItem panelItem;
        RadPanelItem panelSubItem;
        TextBoxTemplate template;

        panelItem = new RadPanelItem();
        panelItem.Expanded = true;

        panelItem.Text = "Grouping";
        panelItem.ExpandedCssClass = "ExpandedCssClass";

        panelSubItem = new RadPanelItem();
        template = new TextBoxTemplate();

        Literal text = new Literal();
        if (Session["current"].ToString() == "True" )
        {
            text.Text = "Course to be taken ";
        }
        else
        {
            text.Text = "Already taken course ";
        }
        panelSubItem.Controls.Add(text);
        Button button = new Button();
        button.Text = "COMPLETE";
        button.ID = "complete1";
        button.Click += new EventHandler(complete_Click);
        panelSubItem.Controls.Add(button);
        template.InstantiateIn(panelSubItem);
        panelItem.Items.Add(panelSubItem);

        coursepanels.Items.Add(panelItem);
                
        courseplaceholder.Controls.Add(coursepanels);

    }

    protected void newcourses_Click(object sender, EventArgs e)
    {
        Session["current"] = true;
        createPanelBar();

    }

    protected void completedcourses_Click(object sender, EventArgs e)
    {
        Session["current"] = false;
        createPanelBar();
    }

    void complete_Click(object sender, EventArgs e)
    {
    }


    class TextBoxTemplate : ITemplate
    {
        public void InstantiateIn(Control container)
        {
        }
    }
}






Jiro Feingold
Top achievements
Rank 1
 answered on 19 Jan 2009
1 answer
431 views

Hello,


In my webpage I try to add a user control into RadPanelBar during
ItemDataBound event. The user control showed up correctly after the 1st page load, but if user do post back the adding control is disappeared. I figured it could be related to viewstate mismatch, so I try give control a unique ID but problem still persist.

 

Any help is very appreciated!

 

Here is my test page code: http://209.200.250.235/Dynamic_panelbar_test.zip

 

Thanks.

(test.aspx)

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="test" %> 
 
<%@ 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" style="height: 100%; width: 100%; margin: 0px;  
padding: 0px; overflow: hidden;"> 
<head runat="server">  
    <title></title>  
</head> 
<body style="height: 100%; width: 100%; margin: 0px; padding: 0px; overflow: hidden;">  
    <form runat="server">  
    <telerik:RadScriptManager ID="uxRadScriptManager" runat="server">  
    </telerik:RadScriptManager> 
      
    <telerik:RadAjaxManager ID="uxRadAjaxManager" runat="server">  
    </telerik:RadAjaxManager> 
      
    <telerik:RadPanelBar ID="uxRadMenuBarML" runat="server" BorderStyle="None" BorderWidth="0px" Height="372px" 
        PersistStateInCookie="True" Width="400px" OnItemDataBound="uxRadMenuBarML_ItemDataBound" 
        OnItemClick="uxRadMenuBarML_ItemClick" Style="" Skin="Office2007" EnableEmbeddedSkins="true">  
    </telerik:RadPanelBar> 
    </form> 
</body> 
</html> 
 

(test.aspx.cs)
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
using System.Globalization;  
 
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming""CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "test")]  
public partial class test : System.Web.UI.Page  
{  
    private List<LFMenuBarDataItem> _menuBarDataItem;  
     
    protected void Page_Load(object sender, EventArgs e)  
    {  
        //enable AJAX update on PanelBar  
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(this.uxRadMenuBarML, this.uxRadMenuBarML);  
    }  
 
    protected override void OnInit(EventArgs e)  
    {  
        base.OnInit(e);  
 
        _menuBarDataItem = new List<LFMenuBarDataItem>();  
 
        //-----------  
 
        AddMenuBarItem(0, "Search""~/UCSearch.ascx");  
        AddMenuBarItem(1, null"Home"""""falsefalse);  
        AddMenuBarItem(2, null"My Inbox"""""falsefalse);  
 
        AddMenuBarItem(3, 1, "dummy item 1"""""falsefalse);  
        AddMenuBarItem(4, 2, "dummy item 2"""""falsefalse);  
 
        //-----------  
 
        uxRadMenuBarML.DataTextField = "Title";  
        uxRadMenuBarML.DataFieldID = "ID";  
        uxRadMenuBarML.DataFieldParentID = "ParentID";  
        uxRadMenuBarML.DataSource = _menuBarDataItem;  
        uxRadMenuBarML.DataBind();  
 
    }  
 
 
    /// <summary>  
    /// Adds the menu bar item. (used by presenter to set menu items)  
    /// </summary>  
    /// <param name="id">The id.</param>  
    /// <param name="parentId">The parent id.</param>  
    /// <param name="title">The title.</param>  
    /// <param name="userControlPath">The user control path.</param>  
    /// <param name="imagePath">The left side image path.</param>  
    /// <param name="isPinDisplayed">if set to <c>true</c> [current pin is displayed].</param>  
    /// <param name="isMenuExpanded">if set to <c>true</c> [current menu is expanded].</param>  
    public void AddMenuBarItem(int id, int? parentId, string title, string userControlPath, string imagePath, bool isPinDisplayed, bool isMenuExpanded)  
    {  
        LFMenuBarDataItem menuBarDataItem = new LFMenuBarDataItem  
        {  
            Id = id,  
            ParentId = parentId,  
            Title = title,  
            PagePath = userControlPath,  
            ImagePath = imagePath,  
            IsPinDisplayed = isPinDisplayed,  
            IsMenuExpanded = isMenuExpanded,  
            IsNestedUserControl = false 
        };  
 
        _menuBarDataItem.Add(menuBarDataItem);  
    }  
 
    /// <summary>  
    /// Adds the menu bar item. (used by presenter to set menu items)  
    /// -this overload is used to install nested user control menu item  
    /// </summary>  
    /// <param name="id">The id.</param>  
    /// <param name="nestUserControlPath">The nest user control path.</param>  
    public void AddMenuBarItem(int id, string title, string nestUserControlPath)  
    {  
        LFMenuBarDataItem menuBarDataItem = new LFMenuBarDataItem  
        {  
            Id = id,  
            Title = title,  
            NestedUserControlPath = nestUserControlPath,  
            IsNestedUserControl = true 
        };  
 
        _menuBarDataItem.Add(menuBarDataItem);  
    }  
 
 
    /// <summary>  
    /// Handles the ItemClick event of the uxRadMenuBarML control.  
    /// </summary>  
    /// <param name="sender">The source of the event.</param>  
    /// <param name="e">The <see cref="Telerik.Web.UI.RadPanelBarEventArgs"/> instance containing the event data.</param>  
    protected void uxRadMenuBarML_ItemClick(object sender, RadPanelBarEventArgs e)  
    {  
          
    }  
 
    /// <summary>  
    /// Handles the ItemDataBound event of the uxRadMenuBarML control.  
    /// </summary>  
    /// <param name="sender">The source of the event.</param>  
    /// <param name="e">The <see cref="Telerik.Web.UI.RadPanelBarEventArgs"/> instance containing the event data.</param>  
    protected void uxRadMenuBarML_ItemDataBound(object sender, RadPanelBarEventArgs e)  
    {  
        LFMenuBarDataItem item = (LFMenuBarDataItem)e.Item.DataItem;  
 
        if (item.IsNestedUserControl) // nested user control  
        {  
            //Control ctl = Page.LoadControl(item.NestedUserControlPath); // load user control  
            Button ctl = new Button(); // here we create a dummy button control for test  
            ctl.Text = "I am a test button. Click me and I should not disappear";  
            ctl.ID = "TestButton" + Guid.NewGuid().ToString();   
              
              
            RadPanelItem radPanelItem = new RadPanelItem();  
            radPanelItem.Controls.Add(ctl);  
 
            e.Item.Items.Clear();  
            e.Item.Items.Add(radPanelItem);  
        }  
        else // normal menubar item  
        {  
            e.Item.ImageUrl = item.ImagePath;  
        }  
 
        e.Item.Value = item.Id.ToString(CultureInfo.InvariantCulture);  
        e.Item.Expanded = item.IsMenuExpanded;  
 
    }  
 
    /// <summary>  
    /// Data class stores menu bar data item  
    /// </summary>  
    internal class LFMenuBarDataItem  
    {  
        public bool IsNestedUserControl  
        {  
            get;  
            set;  
        }  
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance""CA1811:AvoidUncalledPrivateCode")]  
        public bool IsPinDisplayed  
        {  
            get;  
            set;  
        }  
        public bool IsMenuExpanded  
        {  
            get;  
            set;  
        }  
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance""CA1811:AvoidUncalledPrivateCode")]  
        public string Title  
        {  
            get;  
            set;  
        }  
        public int Id  
        {  
            get;  
            set;  
        }  
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance""CA1811:AvoidUncalledPrivateCode")]  
        public int? ParentId  
        {  
            get;  
            set;  
        }  
        public string ImagePath  
        {  
            get;  
            set;  
        }  
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance""CA1811:AvoidUncalledPrivateCode")]  
        public string PagePath  
        {  
            get;  
            set;  
        }  
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance""CA1811:AvoidUncalledPrivateCode")]  
        public string NestedUserControlPath  
        {  
            get;  
            set;  
        }  
    }  
      
}  
 
 

(test.aspx.designer.cs)
//------------------------------------------------------------------------------  
// <auto-generated>  
//     This code was generated by a tool.  
//     Runtime Version:2.0.50727.3053  
//  
//     Changes to this file may cause incorrect behavior and will be lost if  
//     the code is regenerated.  
// </auto-generated>  
//------------------------------------------------------------------------------  
 
 
 
public partial class test {  
      
    /// <summary>  
    /// uxRadScriptManager control.  
    /// </summary>  
    /// <remarks>  
    /// Auto-generated field.  
    /// To modify move field declaration from designer file to code-behind file.  
    /// </remarks>  
    protected global::Telerik.Web.UI.RadScriptManager uxRadScriptManager;  
      
    /// <summary>  
    /// uxRadAjaxManager control.  
    /// </summary>  
    /// <remarks>  
    /// Auto-generated field.  
    /// To modify move field declaration from designer file to code-behind file.  
    /// </remarks>  
    protected global::Telerik.Web.UI.RadAjaxManager uxRadAjaxManager;  
      
    /// <summary>  
    /// uxRadMenuBarML control.  
    /// </summary>  
    /// <remarks>  
    /// Auto-generated field.  
    /// To modify move field declaration from designer file to code-behind file.  
    /// </remarks>  
    protected global::Telerik.Web.UI.RadPanelBar uxRadMenuBarML;  
}  
 

(test.aspx.cs)(test.aspx.designer.cs)
Wei
Top achievements
Rank 1
 answered on 19 Jan 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?