Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
519 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
262 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
172 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
255 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
87 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
205 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
1 answer
85 views
Hi Everybody,

I have problem which I am unable to solve, so maybe somebody can help me out.

I am writing a library (.dll) with SeverControls. (the result is only a dll!) in which several RadControls are wrapped and extended, for example the Grid. 

The problem I want to use a localization file for the grid. If I just copy the files in the app_globalresource folder of a project using my library, the grid does not use the files. Setting the LocalizationPath does not help since the path of course in runtime is different.

Who can help? Thanks in advance!
Daniel
Telerik team
 answered on 07 Oct 2011
1 answer
120 views

I'm opening a radWindow using hyperlink in a grid

Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
       
       If TypeOf e.Item Is GridDataItem Then
         
           Dim item As GridDataItem = CType(e.Item, GridDataItem)
           Dim editLink As HyperLink = CType(e.Item.FindControl("HyperLink1"), HyperLink)
           editLink.Attributes("href") = "#"
           editLink.Attributes("onclick") = "return openWin('/portals/0/NewEducation.aspx?RecID=" + item.GetDataKeyValue("RecID").ToString() + "'); "
  
   End Sub

I then register a button on the new window in the page load

bnSubmit.Attributes("onclick") = "return CloseAndRebind('rebind'); return true;"

I also have code that updates the database when the Submit button is clicked.  Everything works fine in IE9 and Safari but when I run it in Firefox the bnSubmit_Click codes does not run and the window just closes.  If I remove the bnSubmit attribute is there code that I can put in after the bnSubmit.Click that will close the window after I run all of the server side code?

Thanks

Bill

 

Marin Bratanov
Telerik team
 answered on 07 Oct 2011
2 answers
225 views
hi,

I need to change the background color of a ComboBox in javascript,

I'm not getting,

Can someone help me please?

thanks

Andre
Top achievements
Rank 1
 answered on 07 Oct 2011
0 answers
158 views
I have a hierarchical grid which has two layers of hierarchy, one of which contains a Nested Table View (i.e. one primary grid, followed by a child grid, which in turn has a child Nested Table View:

+ Primary grid
   |
   + Child hierarchy
      |
      + Child hierarchy in the form of a Nested Table View

Hope that makes it clear :)

The problem I have is that I have a cascading combo where one loads data following a user selection in the other. Because of potential errors where there's invalid data coming into the rebound combo, I'm having to rebind it in the codebehind. To do this, I'm trying to set up the rebind within the selected combo's SelectionChanged event.

Unfortunately as both combos are in the Nested Table View, I'm having problems working out how to access the combo I want to rebind since neither the 'sender' or EventArgs objects seem to contain enough information to allow me to easily find a path back to the editform. So what's the easiest method of finding a control within an editform in a Nested Table View that's in a hierarchical grid?
David
Top achievements
Rank 1
 asked on 07 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?