Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
4.8K+ views
Hii

We are using RAD Grid, RAD Treeview, RAD Dock and bunch of other controls on a page. Based on node clicked on the treeview, the result in the grid changes. The entire page was working fine in .Net 3.5 perfectly fine. But when we migrated the application to .Net 4.0, the page started shouting. 
Initially it gave JS errors as follow: 

  • Error: ASP.NET Ajax client-side framework failed to load.
  • Error: 'Sys' is undefined
  • Error: 'Telerik' is undefined

And even page was not rendered correctly. It was completely messed up.
After this we added

<add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

entry in web.config file under <handlers> section. After adding it, above errors are gone. 
But now it is throwing following JS error when I click on the treenode. 

Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Debugging shows following error which we caught in Application_Error : 
A potentially dangerous Request.Form value was detected from the client (ctl00$maincontent$dockSearchCriteria$C$SearchAttributeRules1$hidRetVal="<Groups>
<Group>
...").
A potentially dangerous Request.Form value was detected from the client (ctl00$maincontent$dockSearchCriteria$C$SearchAttributeRules1$hidRetVal="<Groups>
<Group>
...").
A potentially dangerous Request.Form value was detected from the client (ctl00$maincontent$dockSearchCriteria$C$SearchAttributeRules1$hidRetVal="<Groups>
<Group>
...").
A potentially dangerous Request.Form value was detected from the client (ctl00$maincontent$dockSearchCriteria$C$SearchAttributeRules1$hidRetVal="<Groups>
<Group>
...").

A potentially dangerous Request.Form value was detected from the client (ctl00$maincontent$dockSearchCriteria$C$SearchAttributeRules1$hidRetVal="<Groups>
<Group>
...").
<Group>
...").
<Group>
...").
<Group>
...").
<Group>
...").
<Group>...").

I am not able to understand why this error is coming and how to get rid of it..
Any help appreciated.
Slav
Telerik team
 answered on 02 Aug 2011
1 answer
97 views
My project uses a heavy collection of RadControls including the AJAX, Menu, Panel, Tabs, etc.  They are literally embedded into every corner of the application.  However, they no longer work when deployed to the Azure cloud.  Everything works fine on localhost.  However, once deployed, all of the controls render (see screenshot) but they aren't functional.  For example:

1) The menu won't pull down to show sub-items
2) The panel won't expand to show the collection of items
3) The tab won't let you move between tabs

There are more examples but in essence, they are all broken in Azure.  They render but lose 100% of functionality.  Any ideas on how to fix?  
Helen
Telerik team
 answered on 02 Aug 2011
1 answer
113 views
Hi,

Will you please let me know if the below code uses flash to upload the file? tats coz I mainly want a method to upload files without flash or silverlight..

I did not get ny samples for FileApi or IFrame.. so was just thinking if I can use this..


.aspx 


<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<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>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />

<div>

     <telerik:RadAsyncUpload ID="RadAsyncUpload1" AutoAddFileInputs="true"  TargetFolder="Files" OnFileUploaded="RadAsyncUpload1_FileUploaded" MultipleFileSelection="Automatic" runat="server">
         
         </telerik:RadAsyncUpload>

        <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="UploadFiles" />

</div>
</form>
</body>
</html>




.aspx.cs

public partial class Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
    {
        // e.IsValid = !CheckUploadedFileValidity();
        if (e.IsValid)
        {
            byte[] buffer = new byte[e.File.ContentLength];
            using (Stream str = e.File.InputStream)
            {
                str.Read(buffer, 0, e.File.ContentLength);

            }
        }
    }


    protected void UploadFiles(object sender, EventArgs e)
    {
// code
    }
}


Helen
Telerik team
 answered on 02 Aug 2011
1 answer
84 views

I created a RadGrid programmatically, and i use the following lines:

 

 

     RadGrid2.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid2_NeedDataSource);

 

instead of  --->   

RadGrid2.DataSourceID = "SqlDataSource1";

 

 

 

i want to create a GridTableView like the above line

 


GridTableView
tableViewOrders = new GridTableView(RadGrid2);

 

¿¿ what should be the declaration to replace ----> tableViewOrders.DataSourceID = "SqlDataSource2"; ???

 

i think somesthing like --->

 

tableViewOrders.NestedViewSettings.DataSourceID += new GridNestedViewSettings(RadGrid3_NeedDataSource);

 

 

but it is incorrect.



tableViewOrders.DataKeyNames =

new string[] { "idCodigos" };

 

 

GridRelationFields relationFields = new GridRelationFields();

 

relationFields.MasterKeyField =

"idCodigo";

 

relationFields.DetailKeyField =

"idCodigoSubGrupo";

 

tableViewOrders.ParentTableRelation.Add(relationFields);

RadGrid2.MasterTableView.DetailTables.Add(tableViewOrders);

 


protected

 

void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

ConnectionStringSettings connectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"];

 

_connection =

DbProviderFactories.GetFactory(connectionString.ProviderName).CreateConnection();

 

_connection.ConnectionString = connectionString.ConnectionString;

 

IDataReader reader;

 

 

using (IDbCommand command = _connection.CreateCommand())

 

{

command.CommandText =

"SpName";

 

command.CommandType =

CommandType.StoredProcedure;

 

_connection.Open();

reader = command.ExecuteReader();

}

((

RadGrid)source).DataSource = reader;

 

}

 

protected void RadGrid2_DataBound(object sender, EventArgs e)

 

{

 

if (_connection.State == ConnectionState.Open)

 

{

_connection.Close();

}

}


thanks in advance

Cristian.-

Tsvetina
Telerik team
 answered on 02 Aug 2011
7 answers
220 views
Hi:

I have just gone live on an application that ports data from a legacy system.  I am getting an exception on editing existing data.  Essentially, the case is different.  So, SQL is happy with the foreign key data, but the RadComboBox is not and causes an exception.  Any suggestions?

Phil
Dimitar Terziev
Telerik team
 answered on 02 Aug 2011
1 answer
132 views

Hi,

      My requirement is to generate PDF while clicking on image button in the grid.In the same page I have one search button(btnSearch). I have implemented OnNeedDataSource event.While clicking on search button I want to rebind the radgrid but I am getting this error “ErrorDetails : System.ArgumentException: Cannot unregister UpdatePanel with ID 'upnlPdf' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel at System.Web.UI.PageRequestManager.UnregisterUpdatePanel(UpdatePanel updatePanel) at System.Web.UI.ScriptManager.System.Web.UI.IScriptManagerInternal.UnregisterUpdatePanel(UpdatePanel updatePanel) at System.Web.UI.UpdatePanel.OnUnload(EventArgs e) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.RemovedControl(Control control) at System.Web.UI.ControlCollection.RemoveAt(Int32 index) at System.Web.UI.ControlCollection.Clear() at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) at Telerik.Web.UI.RadGrid.Rebind() at btnSearch_Click(Object sender, EventArgs e)”.

In aspx Page

===================================================================

<%@ Page Language="C#" MasterPageFile="~/ATMaster.Master" AutoEventWireup="true">

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:UpdatePanel runat="server" ID="upnlSecurityDoc" UpdateMode="Conditional">

        <ContentTemplate>

<telerik:RadGrid ID="RadGrid1" runat="server" Width="1050px" TabIndex="5" Height="350px"

                                        AutoGenerateColumns="False" ForeColor="#333333" PageSize="10" AllowFilteringByColumn="false"

                                        Skin="Outlook" AllowPaging="true" OnNeedDataSource=" RadGrid1_NeedDataSource"

                                        BorderWidth="1px" BorderColor="#cccccc" OnItemCommand=" RadGrid1_ItemCommand"

                                        >

                                        <HeaderContextMenu EnableAutoScroll="True">

                                        </HeaderContextMenu>

                                        <GroupingSettings CaseSensitive="false" />

                                        <MasterTableView PagerStyle-AlwaysVisible="true">

                                            <CommandItemSettings ExportToPdfText="Export to Pdf" />

                                            <Columns>

                                                <telerik:GridTemplateColumn HeaderText="SlNo" AllowFiltering="false">

                                                    <HeaderStyle HorizontalAlign="Left" Font-Bold="true" Width="50px" />

                                                    <ItemStyle HorizontalAlign="Left" Width="50px"></ItemStyle>

                                                    <ItemTemplate>

                                                        <%# this.gvPendingOrder.CurrentPageIndex * this.gvPendingOrder.PageSize + Container.ItemIndex + 1%>

                                                    </ItemTemplate>

                                                </telerik:GridTemplateColumn>

                                               

<telerik:GridTemplateColumn HeaderText="PDF">

                                                    <HeaderStyle Width="50px" />

                                                    <ItemStyle Width="50px" />

                                                    <ItemTemplate>

                                                        <asp:UpdatePanel runat="server" ID="upnlPdf">

                                                            <ContentTemplate>

                                                                <asp:ImageButton runat="server" ID="imgbtnPdf" AlternateText="Security Document Print"

                                                                    CommandArgument='<%# Eval("OrderId") %>' ImageUrl="../Images/pdf_icon.gif" ImageAlign="Middle"

                                                                    CommandName="Generate" ToolTip='<%# "Document" + Eval("OrderNo") + "." %>' />

                                                            </ContentTemplate>

                                                            <Triggers>

                                                                <asp:PostBackTrigger ControlID="imgbtnPdf" />                                                            </Triggers>

                                                        </asp:UpdatePanel>

                                                    </ItemTemplate>

                                                </telerik:GridTemplateColumn>

                                            </Columns>

                                        </MasterTableView>

                                        <ClientSettings EnableRowHoverStyle="true">

                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">

                                            </Scrolling>

                                        </ClientSettings>

                                    </telerik:RadGrid>

</ContentTemplate>

    </asp:UpdatePanel>

</asp:Content>

In code behind

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

        {

            try

            {

                if (e.CommandName == "Generate")

                {

                    string strOrderId = string.Empty;

                    strOrderId = e.CommandArgument.ToString();

                    LocalReport localReport = new LocalReport();

                localReport.ReportPath = Server.MapPath("~/Reports/report1.rdlc");

                localReport.EnableHyperlinks = true;

                localReport.EnableExternalImages = true;

                DataSet dataset1 = new DataSet();

                DataTable datatable1 =GetDetails(strOrderId);

                datatable1.TableName = "Document";

                dataset1.Tables.Add(datatable1.Copy());

                ReportParameter[] @params = new ReportParameter[4];

                localReport.SetParameters(@params);

                //A method that returns a collection for our report Note: A report can have multiple data sources

                localReport.DataSources.Add(new ReportDataSource("dataset", dataset1.Tables[0]));

                string reportType = "pdf";

                string mimeType = string.Empty;

                string encoding = string.Empty;

                string fileNameExtension = string.Empty;

                string deviceInfo = "<DeviceInfo>" + " <OutputFormat>pdf</OutputFormat>" + "</DeviceInfo>";

                Warning[] warnings = null;

                string[] streams = null;

                byte[] renderedBytes = null;

                //Render the report

                renderedBytes = localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);

                //Clear the response stream and write the bytes to the outputstream

                //Set content-disposition to "attachment" so that user is prompted to take an action on the file (open or save)

                Response.Clear();

                Response.ContentType = mimeType;

                strOrderId = "Doc" + strOrderId;

                Response.AddHeader("content-disposition", ("attachment; filename=" + strOrderId + ".pdf"));

                Response.BinaryWrite(renderedBytes);

                Response.End();                }

            }

            catch (Exception ex)

            {

                lblMessage.Text = objUtl.GetErrorMessage(ex, this);

                lblMessage.Visible = true;

            }

        }

Daniel
Telerik team
 answered on 02 Aug 2011
1 answer
106 views
Hi,
I am using fully clickable telerik rad chart in my application...
I can drill down up to 3 levels in chart. When clicking on the bar on main chart, a grid will be displayed and in the grid we have given links to another pages...
Now here the issue is, when value of one bar is too small as compared to another then the bar with too small values is not clickable so I'm unable to drill down to that bar...
I guess this is technical limitation of the control when one bar is having higher values(say in lacs) as compared to another...
So, is there any solution or work around for this??

Thanks in advance...
Vladimir Milev
Telerik team
 answered on 02 Aug 2011
11 answers
373 views
Hi,

I have a few  questions with regards to filtering in RadGrid.
1)
Is there anyway for me to set these filtering settings by default so that I dun have to type this for every columns?
  <telerik:GridBoundColumn DataField="FieldName" HeaderText="1st WS" HeaderStyle-Width="20px"
                    HeaderTooltip="Something" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">

2) When I use CurrentFilterFunction="Contains", how I specify case insensitive matching?

3) Is there anyway to apply the filter without a flicker on the page due to AutoPostBackOnFilter="true" ?


Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Aug 2011
8 answers
269 views
Remove 'Add New Record' command bar color in Telerik Grid

hi ,

i am using a TeleriK grid - Skin = Vista
i have a command bar for adding more records - "Add New Record"
All the functionality is working fine...

My issue is related to look and feel

I want the same look of Grid Headder for the command bar

i want command bar color alos in light blue, as the same of Grid headder
Dilip
Top achievements
Rank 1
 answered on 02 Aug 2011
3 answers
337 views
Hi,

  1. Can we customize the Add/Edit Appointments popup with some additional controls like listbox, fileupload etc.?

  2. How to manage snooze and dismiss/dismiss All buttons of Reminder Popup?

    Actual problem is, even if we have dismiss the reminder it will alert, so how to handle it.

     

Find the Attachment of Appointment Add/Edit Popup we requires - is it possible to create?.

Plamen
Telerik team
 answered on 02 Aug 2011
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?