This is a migrated thread and some comments may be shown as answers.

Microsoft JScript runtime error: 'offsetWidth' is null or not an object

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajendra
Top achievements
Rank 1
Rajendra asked on 02 Apr 2012, 06:29 PM
We added text box in grid header, so user can change the grid header name but when we press the mouse to seleting the grid header text box text and then move mouse to out side the text box.   it thow java script error - "Microsoft JScript runtime error: 'offsetWidth' is null or not an object"
We have underneath seeting for RadGrid : -
 <telerik:RadGrid ID="grdAllTelerik"
                            ShowFooter="true" Skin="Office2010Silver"
                            runat="server" AutoGenerateColumns="false" Width="100%" OnItemCreated="grdAll_RowCreated"
                            OnItemDataBound="grdAll_ItemDataBound" OnNeedDataSource="grdAllTelerik_NeedDataSource">
    <ClientSettings>
        <Resizing AllowResizeToFit="true" ResizeGridOnColumnResize="true" AllowColumnResize="true">
        </Resizing>                                
    </ClientSettings>                           
</telerik:RadGrid> 

if(this._owner._owner._isResize){return;
}var h=Telerik.Web.UI.Grid.GetCurrentElement(g);
var f=Telerik.Web.UI.Grid.GetFirstParentByTagName(h,"th");    ---->  f is null
var a=Telerik.Web.UI.Grid.FindPosX(h);
var c=!!this._owner._owner.ClientSettings.AllowDragToGroup&&this._data.Groupable;
var d=!!this._owner._owner.ClientSettings.AllowColumnsReorder&&this.get_reorderable();
if(c||d){this.get_element().title=this._owner._owner.ClientSettings.ClientMessages.DragToGroupOrReorder;
this.get_element().style.cursor="move";
}if(this._owner._owner.ClientSettings.Resizing.AllowColumnResize&&this.get_resizable()&&Telerik.Web.UI.Grid.GetEventPosX(g)>=(a+f.offsetWidth-5)&&!Telerik.Web.UI.Grid._moveHeaderDiv){this._canDragDrop=false;
}if(this._owner._owner.ClientSettings&&this._owner._owner.ClientSettings.Resizing.AllowColumnResize&&this.get_resizable()&&this.get_element().tagName.toLowerCase()=="th"){var h=Telerik.Web.UI.Grid.GetCurrentElement(g);
if(this._owner._owner.GridDataDiv&&!this._owner._owner.GridHeaderDiv&&!window.netscape){var b=0;

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 05 Apr 2012, 11:54 AM
Hello Rajendra,

I am afraid that we can not determine what is causing this error based on the provided information. Can you paste the related code-behind, so we can test your scenario locally and try to replicate the issue you are facing. Otherwise it will be hard to help you in resolving this problem.

I am looking forward for your reply.

Kind regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Rajendra
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or