Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.


I am really confused about this. Please help me out in this. 

Looking forward for a quick response.
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
1 answer
87 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

This error occurs at  the code line :- 

 SqlDataSource2.SelectParameters[0].DefaultValue = Year.ToString();


I am really confused about this. Please help me out in this. 

Looking forward for a quick response. 
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
1 answer
145 views
I am trying to implement the Demo Code given at :  http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx
I am using same Column names in my database.
It only works for "years" but when i clicked on "2004" or any other year it gives following Error. 

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

This error occurs at  the code line :- 

 SqlDataSource2.SelectParameters[0].DefaultValue = Year.ToString();


I am really confused about this. Please help me out in this. 

Looking forward for a quick response. 
Thank you.
Danail Vasilev
Telerik team
 answered on 10 Sep 2014
3 answers
155 views
Hi,

I use your code from "http://www.telerik.com/help/aspnet-ajax/editor-printing-content-with-styles.html" to print the RadEditor html content and some additional custom information. In particular, I add some email information (sender, recipient, etc.) as the editor is used in an email web client.

A problem arises in the case of external images referenced in the html content, e.g. "<img width="1600" height="900" id="Grafik_x0020_1" src="/an_image_url_comes_here">". These images are not printed. However, the default RadEditor print function does work fine in this case.

How do I make the external images to be printed as well in the custom code?

My code looks like this:

        Telerik.Web.UI.Editor.CommandList["CustomPrint"] = function (commandName, editor, args) {
            var printIframe = document.createElement("IFRAME");
            document.body.appendChild(printIframe);
            var printDocument = printIframe.contentWindow.document;
            printDocument.designMode = "on";
            printDocument.open();

            printDocument.write("<html><head></head><body>" + editor.get_html(true) + "</body></html>");
            printDocument.close();

            try {
                if (document.all) {
                    printDocument.execCommand("Print");
                }
                else {
                    printIframe.contentWindow.print();
                }
            }
            catch (ex) {
                window.alert("error");
            }
            
            //document.body.removeChild(printIframe);
        };

Many thanks!!!

Roland
Ianko
Telerik team
 answered on 10 Sep 2014
3 answers
623 views
Hello,
We are using grid in our project and we are faced to an important issue. There are 3 options to export the data displayed on the grid such as Excel, Pdf, and Word. Excel and Word work just fine both there is a problem with exporting to pdf. When we search the log files we came across that there are invalid characters in the data. But these characters are Ok for office to omit them. I saw a similar question in the forum (this), that solution is not acceptable in our standards and will cause performance issues. The other point is that the solution is only focusing on just specific part of the program. In our case we know one parameter but there will be same or different character at the different part of the program. Here is the exception we caught;
Exception information:
Exception type: GridPdfExportException
Exception message: Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
' ', hexadecimal value 0x1A, is an invalid character. Line 883, position 199.

Do you have a solution for this kind of error?
Thanks,
Ertan
Kostadin
Telerik team
 answered on 10 Sep 2014
1 answer
98 views
Hi
I'm new to Telerik RadGrid and it's databinding. I'm trying to use the ADO.NET Data Service binding but I need to pass parameter. I'm using the sample code but I need to modify it a little bit.

In a perfect world I would add an ID="dbAdoDataService" and runat="server" to the <DataBinding .... > and then in code behind I could use something like dbAdoDataService.SelectParameter = Convert.ToInt32(Request.QueryString["ProductID"]);. But it's not possible to add runat="server" or add an ID to the DataBinding so what can I do to select the rows I want at runtime? And I'm not sure how to modify the GridAdoNetDataService.cs. Please help me I'm stuck.  (Hope you understand my bad english).

Here is the samplecode from Telerik support site:

This is the binding code (Default.aspx):

1.<ClientSettings>
2.    <DataBinding Location="GridAdoNetDataService.svc" SelectCountMethod="GetCount">
3.        <DataService TableName="ReadOnlyProducts" />
4.    </DataBinding>
5.</ClientSettings>

And here is the GridAdoNetDataService.cs:

01.public class GridAdoNetDataService : DataService<NorthwindEntities>
02.{  
03.    public static void InitializeService(IDataServiceConfiguration config)
04.    {      
05.         config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
06.         config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
07.    }
08.  
09.    [WebGet]
10.    public int GetCount(string where)
11.    {
12.        return String.IsNullOrEmpty(where) ? CurrentDataSource.ReadOnlyProducts.Count() :
13.            CurrentDataSource.ReadOnlyProducts.Where(where).Count();
14.    }
15.  
16.}

Kostadin
Telerik team
 answered on 10 Sep 2014
6 answers
435 views

I like the ability to select a row just by clicking anywhere on it, but I don't know how to run a server-side event when it happens. 

Does anyone have an example of how to run a server-side event after clicking anywhere on a row in a RadGrid?  I don't really have room for a select button, so I'm looking for other options.
John
Top achievements
Rank 1
 answered on 09 Sep 2014
3 answers
145 views
Hi there,

I have added a RadDock to RadDockZone1 dynamically from code behind, then drag the RadDock to RadDockZone2, the docks count in RadDockZone2 still shows 0 (
RadDockZone2.Docks.Count). However, if I drag a static dock from RadDockZone1 to RadDockZone2, the dock count number in RadDockZone2 is correct. Please see the following code for details (RadDockTest.aspx and RadDockTest.aspx.cs). Any help is much appreciated. Thank you.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadDockTest.aspx.cs" Inherits="RadDockTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<head id="Head1" runat="server"
    <title>ASP.NET Dock Demo - AutoPostBack</title
     <!--[if lte IE 6]> 
     <style type="text/css"
     .raddockzone{height:250px} 
     </style
     <![endif]-->
     <style type="text/css"
          .qsfConsole { 
               margin-top: 19px; 
          
     </style
</head
<body
    <form id="form1" runat="server"
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" /> 
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" /> 
     <telerik:RadDockLayout runat="server" ID="RadDockLayout1"
          <table
               <tr
                    <td style="vertical-align: top"
                         Docking Zone 1<br /> 
                         <br /> 
                         <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="270px" MinHeight="360px"
                              <telerik:RadDock runat="server" ID="RadDock1" Title="AutoPostBack enabled" 
                                   EnableRoundedCorners="true"
                                   <ContentTemplate
                                        This RadDock control will initiate postback when it is moved around the page. You 
                                        could create AsyncPostbackTrigger to replace the postback with an AJAX call. 
                                   </ContentTemplate
                              </telerik:RadDock
                              <telerik:RadDock runat="server" ID="RadDock2" Title="AutoPostBack disabled"
                                   EnableRoundedCorners="true"
                                   <ContentTemplate
                                        This RadDock control will NOT initiate postback when it is moved around the page. 
                                        However, if you post back the page using another control, the DockPositionChanged 
                                        event will be fired. 
                                   </ContentTemplate
                              </telerik:RadDock
                         </telerik:RadDockZone
                    </td
                    <td style="vertical-align: top"
                         Docking Zone 2<br /> 
                         <br /> 
                         <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="270px" MinHeight="360px"
                         </telerik:RadDockZone
                    </td
               </tr
          </table
     </telerik:RadDockLayout>
     <asp:Button ID="bt_SaveCustomInterfaces" runat="server" Text ="Save Interface" OnClick="bt_SaveCustomInterfaces_Click" />
    </form
</body
</html>
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; 
  
  
public partial class RadDockTest : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadDock dock = CreateRadDock();
        RadDockZone1.Controls.Add(dock); 
    }
  
    protected void bt_SaveCustomInterfaces_Click(object sender, EventArgs e)
    {
        if (RadDockZone2.Docks.Count == 1)
        {
            foreach (RadDock _radDock in RadDockZone2.Docks)
            {
            }
        }
    }
  
    private RadDock CreateRadDock()
    {
        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a");
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);
        dock.Title = "Dock";
        dock.Text = string.Format("Added at {0}", DateTime.Now);
        dock.Width = Unit.Pixel(300);
  
        dock.Commands.Add(new DockCloseCommand());
        dock.Commands.Add(new DockExpandCollapseCommand());
  
        return dock;
    }
}
Meng
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
81 views
I have a radgrid that is entirely created programatically and I'm trying to add a GridCheckBoxColumn.  I want the checkboxes to be editable upon load but they are stuck in read only mode.  I can't figure out how to make them checkable. 

ASPX:
<asp:PlaceHolder ID="phRadGrids" runat="server" />

C#:
RadGrid newGrid = new RadGrid();
newGrid.ID = "grdTesting";
newGrid.MasterTableView.AutoGenerateColumns = false;
 
GridCheckBoxColumn col_Assign = new GridCheckBoxColumn();
col_Assign.HeaderText = "Assign";
col_Assign.UniqueName = "Assign";
newGrid.MasterTableView.Columns.Add(col_Assign);
 
phRadGrids.Controls.Add(newGrid);

The checkbox column shows up fine but it's greyed out and cannot be checked.  Is there an easy way to push this into an editable mode on load?
Keith
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
198 views
Hi Everyone,

I was following this Demo and run into a problem.  In the Web User Control(ascx) page, I need to Evaluate the CheckBox when editing a record.  When I click on Edit, it work great but when I click on "Add new record", I'm getting this error:

Error: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.

This is coming from the Checked function. Below is my coding.

<asp:CheckBox ID="chkbxReadOnly" runat="server"
              Checked='<%# DataBinder.Eval(Container, "DataItem.ReadOnly") %>'
             AutoPostBack="True" />

Can someone help me so  ignore the Checked function when I try to insert a record or modify the above Checked code?
Anthony
Top achievements
Rank 1
 answered on 09 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?