Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
165 views
Hello Telerik,

Whenever I load my page, I get this error message: Microsoft JScript runtime error: 'undefined' is null or not an object. Here is the HTML Source:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TelerikTest.aspx.cs" Inherits="FCReport_Website.TelerikTest" %>
<%@ 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">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">
        </telerik:RadScriptManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgDriverLicenseRenewals">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgDriverLicenseExpired">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgPDPRenewals">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgPDPExpired">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgUnpaidFines">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgLicenseRenewals">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgVehicleLicenseExpired">
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgFuelTransactions">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgDriverLicenseRenewals" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgDriverLicenseExpired" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgPDPRenewals" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgPDPExpired" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgUnpaidFines" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgLicenseRenewals" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgVehicleLicenseExpired" UpdatePanelHeight="" />
                        <telerik:AjaxUpdatedControl ControlID="rgFuelTransactions" UpdatePanelHeight="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" width="300px">
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="Default">
            </telerik:RadAjaxLoadingPanel>
        </telerik:RadAjaxPanel>
 
        <telerik:RadGrid ID="rgDriverLicenseRenewals"
            runat="server"
            AutoEventWireup="True"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgDriverLicenseRenewals_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgDriverLicenseExpired"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgDriverLicenseExpired_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgPDPRenewals"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgPDPRenewals_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgPDPExpired"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgPDPExpired_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgUnpaidFines"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgUnpaidFines_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgLicenseRenewals"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgLicenseRenewals_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgVehicleLicenseExpired"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgVehicleLicenseExpired_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
 
        <br />
        <br />
 
        <telerik:RadGrid ID="rgFuelTransactions"
            runat="server"
            AutoGenerateColumns="True"
            Visible="True"
            AllowFilteringByColumn="True"
            AllowPaging="True"
            AllowSorting="True"
            onneeddatasource="rgFuelTransactions_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>
    </form>
</body>
</html>

And here's the C# source:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using FCReport_Library.Web;
using FCReport_Library.Data;
using System.Text;
using Telerik.Web.UI;
 
namespace FCReport_Website
{
    public partial class TelerikTest : System.Web.UI.Page
    {
        DataSet dsWorkQueue = new DataSet();
 
        protected void Page_Load(object sender, EventArgs e)
        {
             Session["UserID"] = 20;
             GetWorkQueue();
        }
 
        private void GetWorkQueue()
        {
            dsWorkQueue = DataAccess.GetDataSetByStoredProcedure("FCReport_GetWorkQueue", Session["UserID"]);
        }
 
        protected void rgDriverLicenseRenewals_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgDriverLicenseRenewals.DataSource = dsWorkQueue.Tables[0];
        }
 
        protected void rgDriverLicenseExpired_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgDriverLicenseExpired.DataSource = dsWorkQueue.Tables[1];
        }
 
        protected void rgPDPRenewals_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgPDPRenewals.DataSource = dsWorkQueue.Tables[2];
        }
 
        protected void rgPDPExpired_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgPDPExpired.DataSource = dsWorkQueue.Tables[3];
        }
 
        protected void rgUnpaidFines_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgUnpaidFines.DataSource = dsWorkQueue.Tables[4];
        }
 
        protected void rgLicenseRenewals_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgLicenseRenewals.DataSource = dsWorkQueue.Tables[5];
        }
 
        protected void rgVehicleLicenseExpired_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgVehicleLicenseExpired.DataSource = dsWorkQueue.Tables[6];
        }
 
        protected void rgFuelTransactions_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            rgFuelTransactions.DataSource = dsWorkQueue.Tables[7];
        }
    }
}

I really can't figure this out. Am I leaving out controls? Are they in the correct order? Is my C# code wrong?

Cheers,
G
Martin
Telerik team
 answered on 12 Oct 2010
3 answers
441 views
I am using the following method on RadAsyncUpload_FileUploaded:

protected void upAvatar_FileUploaded(object sender, FileUploadedEventArgs e)
{
byte[] imageData = new byte[e.File.InputStream.Length];

using (Stream stream = e.File.InputStream)
{
    stream.Read(imageData, 0, (int)e.File.InputStream.Length);
}

Thumbnail.DataValue = imageData;
}

This is from the Ajax Processing demo under Asynchronous Upload. The function works fine however the temp file is locked and cannot be deleted for approximately 5 minutes. If I comment out the contents of this function, the file can be deleted immediately. I am setting TemporaryFileExpiration = new TimeSpan(0, 0, 10) so when the file delete occurs an event is logged in the Event Viewer similar to this: 

Exception information: 
    Exception type: IOException 
    Exception message: The process cannot access the file 'h:\Websites\Project\App_Data\RadUploadTemp\1ng3c0wt.bdu' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.Delete(String path)
   at Telerik.Web.UI.AsyncUploadHandler.RemovedCallback(String key, Object value, CacheItemRemovedReason reason)
   at System.Web.Caching.CacheEntry.CallCacheItemRemovedCallback(CacheItemRemovedCallback callback, CacheItemRemovedReason reason)

I attempted to do a stream copy to work with the contents of the uploaded file separately but the temporary file still remains locked. It seems that a simple read of e.File.InputStream locks the file. Is there any way around this? The only way I have found so far is to set the TemporaryFileExpiration to a greater value (>10min). Thanks.

Jason Rosensweig
Top achievements
Rank 1
 answered on 12 Oct 2010
3 answers
103 views
Hello, I am using rad uploader and it works fine on my developer machine. When i try to upload files on the test server the files do not get uploaded. The icon in the left of the file name keeps circling forever and it never turns into a checkmark as it does on my machine. If i click the postback button while the icon keeps circling throws an exception as the file does not exists. I have granted permissions to the respective folders.
Genady Sergeev
Telerik team
 answered on 12 Oct 2010
2 answers
246 views
Hello everyone.

I put a window on a page for posting comments; it works great but when it opens, the title bar is semi-transparent as you can see from the attached image (the main window has a chart in it).

Also, even though the WindowManager has EnableShadow = true, there is no shadow on the background.

I read on another post that there could be an issue with <ul> definitions on the CSS file. I have no RadWindow settings on the CSS file.

Here is my code:

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
        EnableShadow="True" Behavior="Default" InitialBehavior="None">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Close, Move" 
                NavigateUrl="Comment.aspx" VisibleStatusbar="False" Behavior="Close, Move" 
                Overlay="True">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
  
  
ul.nav
{
    padding:0px;
    margin:0px;
    height:37px;
}
ul li 
{
    height:37px;
}
ul li.first {
    margin-left: 0;
    border-left: none;
    list-style: none;
    display: inline;
    padding: 0px;
    font-family: Franklin Gothic Medium;
    padding: 0px 8px 0px 0px;
}
ul.nav img
{
    border:0;
}
ul li.selected 
{
    margin-left: 0;
    padding: 0px;
    list-style: none;
    display: block;
    float:left;
    font-family: Franklin Gothic Medium;
}
ul.nav li a
{
    display:block;
    height:37px;
    float:left;
    line-height:30px;
    padding: 0px 8px;
}
ul.nav li img
{
    float:left;
}
ul.nav li.selected a
{
    background:url("../Images/Top_Nav_Selected_Fill.gif");
    background-repeat:repeat-x;
    background-color:#5e5e60;
    border:none;
    padding:0px;
}
Ivan
Top achievements
Rank 1
 answered on 12 Oct 2010
1 answer
650 views

Hi

               I am working on RadGrid with user Control as Popup, once clicked on Save Button of user Control

   new row should be inserted without going to Code Behind(In javascript),how can i do that.

Marin
Telerik team
 answered on 12 Oct 2010
1 answer
87 views

Is there a way to prevent the first row from being automatically selected in a grid?

Im rendering a grid without any selection allowed (ClientSettings.Selecting.AllowRowSelect = "false", AllowRowSelect="false") but the tr tag for the first row in the grid still automatically has its class set to hrgRow rgSelectedRow.

Pavlina
Telerik team
 answered on 12 Oct 2010
2 answers
122 views
Hi,

I have a RadGrid and another grid inside as NestedViewTemplate.

Whenever I click on expand button for any row, NeedDataSource for Parent Grid is also getting called, causing performance issues.

Is there a way I can avoid this?

Please let me know if any more information is needed.

Thanks.
spt3210
Top achievements
Rank 1
 answered on 12 Oct 2010
1 answer
127 views
Hello Sir,

I am facing one problem in radgrid.The issue is when we decrease any one or more column width than it will create blank space after the last column.if i put UseStaticHeaders="False" than it is fine but some other issue is created like pager control are coming up side if "No records to display".also some scroll issue.So i need to remove space issue when UseStaticHeaders="True".
Pls help me.

Thanks
Jignesh Patel
Dimo
Telerik team
 answered on 12 Oct 2010
6 answers
187 views
Hello,

We would like to make the drop down area wider in order to show the full text of the combo box items.

I have the following code:  (The combo is set to 250px width)

 

 

 

protected void LstAgency_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        LstAgency.Items.Clear();
  
        if (e.Context["CustomText"].ToString().Length >= 2)
        {
            data = APIHelper.GetCompanies(e.Context["CustomText"].ToString());
  
            ShowSmartCombo(e, LstAgency, data, "Name");
        }
  
        // We want to show the drop down to the width of the longest company name. 
        // Use approx. 3 px per character. iLongestName * 3
        LstAgency.DropDownWidth = new Unit(800, UnitType.Pixel);
    }

But the DropDownWidth does not change. I have stepped through the code to make sure it's setting the DropDownWidth, but nothing happening.

Is it because we can't change the width of the drop down in the onItemRequested event?

Thanks,
Annie

 

Cori
Top achievements
Rank 2
 answered on 12 Oct 2010
1 answer
288 views
Hi Guys,

I'm playing around with the RadEditor for the first time. I want to databing the content to my datasource but can't seem to work out how.

My datasource;

 

<asp:SqlDataSource ID="sdsJobDetails_viewJobs" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Gateway10.My.MySettings.dbConnString %>" 
    SelectCommand="SELECT * FROM [viewJob] WHERE ([jobID] = @jobID)" 
    ProviderName="<%$ ConnectionStrings:Gateway10.My.MySettings.dbConnString.ProviderName %>">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="jobID" 
            QueryStringField="jobID" Type="Int64" />
    </SelectParameters>
</asp:SqlDataSource>


This doesn't work;

<telerik:RadEditor ID="RadEditor1" runat="server" Height="300px" Width="100%" DataSourceID="sdsJobDetails_viewJobs" 
    EditModes="Design" EnableResize="False" Content='<%#Bind("jobTextNotes")%>'>

Rumen
Telerik team
 answered on 12 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?