Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
260 views
Can someone advise me on what are the best ways to pass data to RadWindows.


At the moment i'm adding them onto the querystring i'm opening RadWindow with, but its becoming more complex. In this circumstance, i'd like to pass a mySQL query to the radwindow. I don't want to do this in the Querystring because it will get absolutely massive.

I could add it to a session, and do it that way, but i just want to do the best way. I assume RadWindow cannot access the viewstate of its parent window, if i store it in there?

Thanks,

Alan
Marin Bratanov
Telerik team
 answered on 07 Oct 2011
1 answer
44 views
I am using a combination of several Gnatt series and a Point series to show status over a period of time (with the Gnatt series) and specific events with the points.  I am using the tooltip to show detailed information about both the date range and the specific events.  My issue is that there is a disconnect in how the tooltips (via image map) and visual series are layered. 

For display purposes, the series are layered in the order they are added with the last added series sitting on top of the others, this is fine I add my range series first and then add the point series and they display as I want with the events showing up overlaying the ranges.  The problem is that the image map which is used for the tooltips is also assembled in the order the series are added, but in practice this has the effect of obscuring the poly used for the point tooltip underneath the poly for the ranges.

I can work around the problem by closing the point series and adding it as the first series and again as the last series so it shows up both with tooltips and visually.  Is there any other way to correct this problem?
Yavor
Telerik team
 answered on 07 Oct 2011
1 answer
324 views
Hi,

I am getting am getting the error "unterminated string constant" when I try to call a rad alert from code behind.  I know the problem is that the message that is being sent to the radalert contains invalid characters but I am not sure how to fix it. 

I am calling the radalert on a grid's ItemUpdated event and am putting the e.exception.message in the string that I pass to the radalert and apparanetly it has invalid characters.   Since I can't control what the characters are in the e.exception.message, is there a way to send this information to a radalert so that it will accept the e.exception.message.

The e.exception message is
Incorrect syntax near ','.
Unclosed quotation mark after the character string ".

Below is the code I am using to call the radalert.
Protected Sub rgvSecurityUsers_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles rgvSecurityUsers.ItemUpdated
    If Not e.Exception Is Nothing Then
        Dim EditItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
        Dim strUserId As String = EditItem.GetDataKeyValue("UserID").ToString()
        Dim strUserName As String = TryCast(EditItem("UserName").Controls(0), TextBox).Text
        Dim strMessage As String = "User " + strUserId + " " & strUserName & " cannot be updated. Reason: " + e.Exception.Message
        MsgBox(e.Exception.Message)
        Dim scriptstring As String = "radalert('" + strMessage + "', 330, 210);"
        e.KeepInEditMode = True
        e.ExceptionHandled = True
        ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "radalert", scriptstring, True)
    End If
End Sub

Thank You
Tracy
.
Marin Bratanov
Telerik team
 answered on 07 Oct 2011
1 answer
123 views
Hello,

I am trying to change the text of the buttons inside the popup, but nothing I have tried works. My version is Q1 2011.
I tell you what I have tried:

1.- Setting the properties in design mode:

<telerik:RadMonthYearPicker ID="rmypMesDeCierre" runat="server" Width="150px" Culture="Spanish (Spain)">
                <MonthYearNavigationSettings OkButtonCaption="Ok" CancelButtonCaption="Cancelar" TodayButtonCaption="Hoy" />
</telerik:RadMonthYearPicker>


2.- Setting on server side at run time:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Me.rmypMesDeCierre.MonthYearNavigationSettings.TodayButtonCaption = "Hoy"
    Me.rmypMesDeCierre.MonthYearNavigationSettings.CancelButtonCaption = "Cancelar"
  End Sub


3.- Setting on client load event:

function page_load() {
      var m = $find("<%= rmypMesDeCierre.ClientID %>");
      var m2 = m.get_monthYearNavigationSettings();

      m2[0] = 'Hoy';
      m.set_monthYearNavigationSettings(m2);
    }

    Sys.Application.add_load(page_load);


Could you help me?
Thanks in advance.
Luis
Top achievements
Rank 1
 answered on 07 Oct 2011
1 answer
443 views
Hi,
I have a small problem that irritates me.

In a radgrid I have currency columns format set to

DataFormatString

 

 

="{0:C2}

 


which in my case gives me output as 2.999,00 kr, 289,00 kr, etc.

Problem is that when I export radgrid to excel then above examples will be seen as two different formats in excel and I can't for example summarize a column since it is seen as two different formats, ex below

203,00
186,00
3.233,00 kr
137,00
213,00
157,00
173,00
546,00
751,00
1.750,00 kr
1.750,00 kr
150,00

Reason is that my excel is having another format for amounts >= 1000 kr which is 3 233,00 kr. So how to get amounts in my excel currency format when I export radgrid? Ex as below

203,00 kr
186,00 kr
3 233,00 kr
137,00 kr
213,00 kr
157,00 kr
173,00 kr
546,00 kr
751,00 kr
1 750,00 kr
1 750,00 kr
150,00 kr

I tried to change to DataFormatString="{0:####,## kr} in the radgrid but that solved not my problem.

Thx in advance!

Rgds,
Jesper
Daniel
Telerik team
 answered on 07 Oct 2011
7 answers
197 views
I'm facing an issue with the RadWindow control. If you attempt to drag the window during a postback and the server-side code attempts to close the window via script, the window closes and then re-appears. When the window re-appears, you are not able to close this window using the "X" icon.

Telerik Version: 2011.1.413.40.

Steps to Reproduce:
1. Click "Open Dialog" button.
2. Click "Submit" button in the window. This issues a Thread.Sleep(5000) in the Submit button click event to simulate a long-running task. 
3. While the window is posting-back, drag the window around.
4. The window will close, via script from the server-side postback using ScriptManager.RegisterStartupScript to close the window using javascript similar to: "var radWindow = GetRadWindow(); radWindow.close();". 
5. Observe that the window re-appears.
6. Now, attempt to close the window. You cannot close this dialog.

Default.aspx Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadWindowManager ID="WindowManager" runat="server" Behaviors="Move,Close,Resize" DestroyOnClose="true" KeepInScreenBounds="true" Modal="true" ReloadOnShow="true" ShowContentDuringLoad="false" VisibleStatusbar="false">
        <Windows>
            <telerik:RadWindow ID="DialogWindow" OpenerElementID="OpenDialogButton" NavigateUrl="Dialog.aspx" runat="server" Width="650px" Height="450px">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
 
    </telerik:RadAjaxManager>
    <div>
    <h1>Test Window Drag Issue</h1>
    <ol>
        <li>1. Click "Open Dialog".</li>
        <li>2. Click "Submit" button in the window. This issues a Thread.Sleep(5000) to simulate a long-running task.</li>
        <li>3. While the window is posting-back, drag the window around.</li>
        <li>4. The window will close, via script from the server-side postback. And then the window will re-appear.</li>
        <li>5. Now, attempt to close the window. You cannot close this dialog.</li>
    </ol>
    <p>Click "Open Dialog" button.</p>
    <asp:Button ID="OpenDialogButton" runat="server" Text="Open Dialog" />
    </div>
    </form>
</body>
</html>

Dialog.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dialog.aspx.cs" Inherits="RadControls_WindowIssue.Dialog" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxPanel id="AjaxPanel1" LoadingPanelID="LoadingPanel1" runat="server">
        <h1>Dialog Page</h1>
        <p>A sample dialog to illustrate the issue.</p>
        <ol>
            <li>1. Click the Submit button.</li>
            <li>2. The postback event has a Thread.Sleep(5000) - 5 seconds. Then, the server-side code issues a close window script.</li>
            <li>3. While the page is in the middle of a post-back, drag the Window.</li>
            <li>4. Observe that when the window closes, it opens back up and is visible. However, now you cannot close the dialog.</li>
        </ol>
        <asp:Button id="SubmitButton" runat="server" Text="Submit" OnClick="SubmitClick" />
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" Skin="Default" runat="server" />
    </form>
</body>
</html>

Dialog.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace RadControls_WindowIssue
{
    public partial class Dialog : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void SubmitClick(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(5000);
 
            ScriptManager.RegisterStartupScript(this, GetType(), "close", "CloseModal();", true);
        }
    }
}

scripts.js
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.radWindow;
    else if (window.frameElement && window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow;
 
    return oWindow;
}
function CloseModal() {
    var radWindow = GetRadWindow();
    radWindow.close(returnValue);
}

Marin Bratanov
Telerik team
 answered on 07 Oct 2011
1 answer
95 views
This is probably a stupid request, but our users want to see text like "Excellent", "Good", "Fair", "Poor", like you use for "Items", but they want to be able to select BETWEEN each item...more like "Ticks".  Also, there are underlying numbers that represent each of these selections.  I changed my slider from Item to Tick, but it just shows the numbers.  I can't get it to show the Text.  Can I change that somehow?  I know your control isn't made to handle this.  I was just hoping there was/is a work around.

thanks

Mark
Slav
Telerik team
 answered on 07 Oct 2011
1 answer
212 views
I have a radgrid that I would like to have the data be exported to an excel document using RadGrid.MasterTableView.ExportToExcel().  The RadGrid contains a GridTemplateColumn which has the following RadAjaxPanel:


 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" RestoreOriginalRenderDelegate="false" runat="server">

 

 

 

<asp:LinkButton ID="linkbuttonShowHide" runat="server" Text="Show Group Questions"

 

 

 

Font-Size="xx-small" Visible="false" CommandArgument='<%# Eval("QID") %>'

 

 

 

OnCommand="linkbuttonShowHide_Command" CommandName="Click" />

 

 

 

<asp:Panel ID="panel" Visible="false" runat="server">

 

 

 

<asp:GridView ID="gridview1" Visible="true" CssClass="tablescale" runat="server"

 

 

 

ShowHeader="false" ShowFooter="false" AutoGenerateColumns="false">

 

 

 

<Columns>

 

 

 

<asp:BoundField DataField="id" Visible="true" />

 

 

 

<asp:BoundField DataField="text" Visible="true" HtmlEncode="false" />

 

 

 

</Columns>

 

 

 

</asp:GridView>

 

 

 

</asp:Panel>

 

 

 

</telerik:RadAjaxPanel>



when the grid is first loaded the panel is not visible, then when the linkbutton is clicked it is opened with roughly the following code:

 

 

 

protected void linkbuttonShowHideRRQuests_Command(object sender, CommandEventArgs e)

 

{

 

 

LinkButton _lbShowRR = (LinkButton)sender;

 

 

 

GridView _gvRR = (GridView)((LinkButton)sender).Parent.FindControl("gridview1");

 

 

 

Panel _panelRR = (Panel)((LinkButton)sender).Parent.FindControl("panel");

 

 

 

if (_lbShowRR.Text != "Show Questions")

 

{

_lbShowRR.Text =

 

"Show Questions";

 

_gvRR.DataSource =

 

null;

 

_gvRR.DataBind();

 

 

 

 

_panelRR.Visible =

 

false;

 

}

 

 

else

 

 

 

 

 

{

_lbShowRR.Text =

 

"Hide Questions";

 

_gvRR.DataSource =

 

this.GroupQuestions;

 

_gvRR.DataBind();

 

 

 

 

_panelRR.Visible =

 

true;

 

}

 

 

 

 

}

When I add code to export the grid to excel where:
 

 

RadGrid.ExportSettings.ExportOnlyData =

 

true;

 

RadGrid.ExportSettings.IgnorePaging =

 

true;

 

RadGrid.ExportSettings.OpenInNewWindow =

 

true;

I am binding the data in the OnNeedDataSource event of the grid.

The issue I am having is that when RestoreOriginalRenderDelegate="false", the panel will not open, but when RestoreOriginalRenderDelegate="true", the panel will open but the export does not work correctly, I get the

 

Object reference not set to an instance of an object.

error that I have seen in a few other posts. 

I have looked at a few posts and have tried setting the inheritance of the page to the RadAjaxPage and also try to implement IRadAjaxPage, none of this seems to work. 

Is there any other work arounds where both can happen, I can export to excel and I can open the panel within the ajax panel?

Thanks for your help!

Aaron

 

 

 

 

 

 

 

 

 

Daniel
Telerik team
 answered on 07 Oct 2011
1 answer
54 views
I'm trying to manually hide/display some buttons on command item template of a detail table but I've been unsuccessful. I thought changing visibility in OnItemCommand would do it, since I know at that time which detail table to change and which command is executed but it's not working. I've found some posts that suggest hiding items during OnItemCreated event but then I don't know for which detail table... Any ideas?
Tsvetina
Telerik team
 answered on 07 Oct 2011
5 answers
164 views
Hi. i'm trying to make StackedSplineArea100  chart.
i saw indicating Ycolumn convert numeric to Percentage at this hyperlink. and i want to show like this.
http://www.telerik.com/help/aspnet-ajax/radchart-types-stacked-spline-area-100.html

here is my code.
this code has a problem that all Ycolumn value is 0%.
<telerik:RadChart ID="RadChart1" runat="server" DefaultType="StackedSplineArea100 " Width="1000" Height="800">
</telerik:RadChart>
Imports Telerik.Web.UI
Imports Telerik.Charting
 
Partial Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
 
        RadChart1.DataGroupColumn = "Year"
 
        RadChart1.DataSource = ChartData.GetGrouplData()
        RadChart1.DataBind()
 
        For i As Integer = 0 To RadChart1.Series.Count - 1
 
            RadChart1.Series(i).DataXColumn = "Month"
            RadChart1.Series(i).DataYColumn = "MonthCount"
            RadChart1.Series(i).DefaultLabelValue = "#%"
        Next
    End Sub
End Class
 
Public Class ChartData
    Public Shared Function GetGrouplData() As DataTable
        Dim dataTableGroupData As New DataTable()
        dataTableGroupData = New DataTable()
        dataTableGroupData.Columns.Add("Year")
        dataTableGroupData.Columns.Add("Month")
        dataTableGroupData.Columns.Add("MonthCount")
 
        dataTableGroupData.Rows.Add(New Object() {"2009", "1", "50"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "2", "20"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "3", "70"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "4", "143"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "5", "210"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "6", "250"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "7", "252"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "8", "396"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "9", "406"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "10", "470"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "11", "472"})
        dataTableGroupData.Rows.Add(New Object() {"2009", "12", "431"})
 
        dataTableGroupData.Rows.Add(New Object() {"2010", "1", "10"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "2", "50"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "3", "234"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "4", "101"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "5", "231"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "6", "482"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "7", "20"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "8", "87"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "9", "58"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "10", "10"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "11", "99"})
        dataTableGroupData.Rows.Add(New Object() {"2010", "12", "312"})
 
        GetGrouplData = dataTableGroupData
    End Function
End Class

how can i solve this problem? thanks you
Missing User
 answered on 07 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?