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

Binding Error when Enter/Intro/Return Key is pressed

3 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 10 Feb 2017, 03:52 PM

I have an ASPX Site with Telerik AJAX, in a editable RadGrid with EditMode="EditForms", each time user press Return, system shows an Object Reference not set to an instance of an object.

RadGrid Definition

 

<telerik:RadGrid RenderMode="Lightweight" ID="GridSCG" runat="server" AutoGenerateColumns="False"
            AllowFilteringByColumn="True" AllowSorting="True" AllowPaging="True" Culture="es-MX"
            OnNeedDataSource="GridSCG_NeedDataSource" OnDeleteCommand="GridSCG_DeleteCommand"
            OnInsertCommand="GridSCG_InsertCommand" OnItemCreated="GridSCG_ItemCreated" OnUpdateCommand="GridSCG_UpdateCommand"
            CellSpacing="-1" GridLines="Both" OnItemDataBound="GridSCG_ItemDataBound" Skin="Telerik">
            
            <PagerStyle PageSizeControlType="RadDropDownList" Mode="NextPrevAndNumeric"></PagerStyle>
            <ClientSettings AllowKeyboardNavigation="true">
                <ClientEvents OnKeyPress="OnKeyPress" />
            </ClientSettings>
            <FilterMenu RenderMode="Lightweight"></FilterMenu>
            <HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
            <ClientSettings AllowKeyboardNavigation="true">
                <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" AllowResizeToFit="true" />
                <ClientEvents OnRowDblClick="rowDblClick" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2"></Scrolling>
            </ClientSettings>

            <MasterTableView AutoGenerateColumns="False" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="EditForms"
                DataKeyNames="DTA_SECUENCIA" CommandItemDisplay="Top">
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="DTA_SECUENCIA" SortOrder="Descending" />
                </SortExpressions>

This is the Error

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.GridDateTimeColumnEditor.set_Text(String value) +73
   Telerik.Web.UI.GridBoundColumn.OnDataBindColumn(Object sender, EventArgs e) +2669
   System.Web.UI.Control.OnDataBinding(EventArgs e) +84
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +150
   System.Web.UI.Control.DataBind() +17
   System.Web.UI.Control.DataBindChildren() +185

 

 

 

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 15 Feb 2017, 01:33 PM
Hi Victor,

Pressing the Enter key performs a PostBack initiated by the default button on the Page. In a RadGrid scenario the default button usually is the Insert one - can you press the "Add new record" button manually and see whether the same error is thrown? Can you also debug the OnInsertCommand,  OnItemDataBound and OnItemCreated handlers and see whether their logic is executed without any errors?

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Victor
Top achievements
Rank 1
answered on 15 Feb 2017, 05:55 PM

Hi Vessy,

The error also happens when presing the button while i'm trying to add a new record, i have debuged all funcions, even with try catch but there are not visible errors.

But finally i managed to avoid error, i delete an imput validator and a window manager, someone might be causing the error.

0
Vessy
Telerik team
answered on 16 Feb 2017, 08:18 AM
Hi Victor,

Most probably there is a broken AJAX request on the page related to the updating of these controls but I can only guess without being able to examine the problem at my end. Would it be possible for you to prepare a simplified runnable version of your project containing only the code needed for for reproducing the error and send it so we can debug it locally?

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Victor
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Victor
Top achievements
Rank 1
Share this question
or