Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
150 views
I have simple page in Net 4.0 and getting below error and below you will the code as well

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.PreControlToAjaxify.Render(HtmlTextWriter writer) +113
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +306
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +666
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4942


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1



Code:
Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <uc1:WebUserControl ID="WebUserControl1" runat="server" />

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



Default.aspx.cs:

using System;

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

    }
}



WebUSerControl.acsx:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="OrdersGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="OrdersGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="EmployeesGrid">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" />
                <telerik:AjaxUpdatedControl ControlID="EmployeesGrid" />
            </UpdatedControls>
        </telerik:AjaxSetting>
       
    </AjaxSettings>
 
</telerik:RadAjaxManagerProxy>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<telerik:RadGrid ID="EmployeesGrid"  runat="server" AutoGenerateColumns="true"
    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="5"
    GridLines="None" ShowStatusBar="true" style="margin-bottom: 20px;">
    <PagerStyle Mode="NumericPages"></PagerStyle>

    <ClientSettings EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>

<telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1"
    SelectedIndex="0">
    <Tabs>
        <telerik:RadTab runat="server" Text="Sanjay" PageViewID="PageView1" />
        <telerik:RadTab runat="server" Text="Sanjay" PageViewID="PageView2" />
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
    <telerik:RadPageView runat="server" ID="PageView1">
    <telerik:RadGrid ID="RadGrid1"  runat="server" AutoGenerateColumns="true"
    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="5"
    GridLines="None" ShowStatusBar="true" style="margin-bottom: 20px;">
    <PagerStyle Mode="NumericPages"></PagerStyle>

    <ClientSettings EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>
   
    </telerik:RadPageView>
    <telerik:RadPageView>
    <telerik:RadGrid ID="RadGrid2"  runat="server" AutoGenerateColumns="true"
    AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="5"
    GridLines="None" ShowStatusBar="true" style="margin-bottom: 20px;">
    <PagerStyle Mode="NumericPages"></PagerStyle>

    <ClientSettings EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" />
    </ClientSettings>
</telerik:RadGrid>
   
    </telerik:RadPageView>
      </telerik:RadMultiPage>

 



WebUserControl.acxs.cs:

using System;
using System.Data;

public partial class WebUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();

 

        dt.Columns.Add(new DataColumn("Contract Number", typeof(string)));

        dt.Columns.Add(new DataColumn("Customer Name", typeof(string)));

    

        DataRow dr = dt.NewRow();

       

        dr["Customer Name"] = "Sanjay"; 
        dr["Contract Number"] = "Sanjay";

        dt.Rows.Add(dr);

        EmployeesGrid.DataSource = dt;
        EmployeesGrid.DataBind();
       

    }
}

Maria Ilieva
Telerik team
 answered on 02 May 2011
2 answers
87 views
is there is anyway to make the radwindows just load on demand like radtooltip?
i mean load on demand an ascx control in the ContentTemplate
Svetlina Anati
Telerik team
 answered on 02 May 2011
1 answer
85 views
Hi, 

The tooltip doesn't work in IE7 version. It works fine in IE8/9 and other browsers. could you please help me in finding out why it isn't. I see that Radtooltip is browser compatible and should work well across all the browsers, but am not able to figure out why this is happening with my code. 

I would greatly appreciate your help on this. Already spent hours on debugging this issue.


Thanks.
Svetlina Anati
Telerik team
 answered on 02 May 2011
1 answer
234 views
Hi,

I am using the RadUpload control and facing problems with that.

Whenever I submit the page

UploadedFiles.Count

Always returns the 0, I am using it in a very simple page with just the Upload control and the asp Button to submit.
 
I want to clerify that I am not using any ajax functionality, it is just a simple page.

Anyone knows about this problem??

I have attatched my project, Please suggest something.
Peter Filipov
Telerik team
 answered on 02 May 2011
5 answers
71 views
Hi,

Following this demo - I can't get the window to style as I wish (with a skin or a size). The demo itself uses a default setting.
Is it possible please?

Cheers,

Jon
Georgi Tunev
Telerik team
 answered on 02 May 2011
4 answers
122 views
Hi, I've been trying to find documentations to switch to css sprites for my navigation menu. I have too many http requests which is slowing down my site. I currently have 4 navigation tabs with hover and active links. I've sliced each tabs and am having a hard time figuring out how to incorporate the css sprites with the telerik. Can someone please help me? I'm very new to Telerik.

Thanks,
Karly
Kate
Telerik team
 answered on 02 May 2011
3 answers
145 views

hi

I use Telerik.Web.UI.dll v2011.1.419.40

and my web host use windows server 2003 + IIS6

and I use RadScriptManager + RadChart in my web site 

what is correct form of my web.config?

<?xml version="1.0"?>
<configuration>
  <system.web>
    <machineKey validationKey="4E034E7E4D3A8BD7B883864A59A1DCE0F0830BBB7A8EA155F5E3C43640F53EE78D1FD427F4C7A1FC88C273BD134A4A55F329EB552379EE45E74C5FA298CD270F"
      decryptionKey="6D0118305061DE29C50CC073F906B4861CEE55D1CB1EBBE31D04220359C6794C" validation="SHA1" decryption="AES" />
    <compilation debug="false" defaultLanguage="C#" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    <httpRuntime maxRequestLength="1024" requestLengthDiskThreshold="64" requestValidationMode="2.0"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="csm" namespace="customWebControls"/>
        <add tagPrefix="tlk" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
    <httpModules>
      <add name="customErrorModule" type="customErrorModule"/>
    </httpModules>
    <httpHandlers>
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="customErrorModule" type="customErrorModule"/>
    </modules>
    <handlers>
    </handlers>
  </system.webServer>
</configuration>

Bartholomeo Rocca
Top achievements
Rank 1
 answered on 02 May 2011
3 answers
178 views
Well.

Please notice the bold, italicized line in the function below.  It works fine (retrieves NEW, user-modified values from the RadGrid) after a fresh load of the page, but after a postback of the page, it retrieves the OLD values from the RadGrid.

Is there any Telerik-related reason this would happen?  I really have no idea why the postback page works differently than the original page load.

private static void CaptureChangesInGrid(RadGrid targetGrid)
{
    //Loop through each targetgrid item
    foreach (GridDataItem gridRow in targetGrid.MasterTableView.Items)
    {
        Dictionary<object, object> editDict = new Dictionary<object, object>();
        targetGrid.MasterTableView.ExtractValuesFromItem(editDict, (gridRow as GridEditableItem));
        foreach (GridColumn column in targetGrid.MasterTableView.Columns)
        {
            CustomEditableColumn editableCol = column as CustomEditableColumn;
            GridEditableColumn editColumn = editableCol as GridEditableColumn;
            if (editableCol != null)
            {
                //Find the edit control in the given row
                System.Web.UI.Control editItem = editableCol.FindControlInRow(gridRow);
   
                if (editItem == null)
                {
                    throw new ApplicationException("Unable to find edit control in for column: " + editableCol.HeaderText);
                }
                editableCol.CheckControlForChange(editItem, GetValueFromDictionary(editableCol, editDict));
            }
        }
    }
}

Does anyone have a better way of retrieving user-entered values on a RadGrid which works after successive postbacks to the page?  Or is there a way to fix this?

EnableViewState is enabled for the page.

The data entered is required for modifying the appearance of the page (highlighting for errors in entries, etc.) and thus I cannot have a fresh load performed every time.  An undesirable option might be to place any user-edited data into the viewstate and perform a full refresh of the page and replace old data with the saved viewstate data... but that sounds like a lot of additional code for which I really don't have the time to create.

I'll be here all day, talk to me!

Thanks,
Jon
Marin
Telerik team
 answered on 02 May 2011
1 answer
147 views
Hi;
We are using RADLIST box we have an unusal requirement after everyword inside the listbox there has to be some white spaces in betwwen the word for example "Hello                                                                         World".
but when I give this inside the listbox the spaces get truncated to "Hello World".
Can you please tell me that how can I acihve this functionality as it is very urgent for me.
please let me know ASAP.
Dimitar Terziev
Telerik team
 answered on 02 May 2011
1 answer
66 views

Hi,

Is it possible to make the cursor inside the editor to look bigger? if i change the fonts inside the editor will it be ok?

I am asking because it's for some one with eye problems.


Regards,
Eleni
Rumen
Telerik team
 answered on 02 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?