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

Radgrid Error on BatchEditMode = Row not Cell

9 Answers 187 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 2
Stefan asked on 21 Aug 2013, 04:48 PM

Everything was working but all of a sudden I am getting the following error on a radgrid in batch edit mode.

Unhandled exception at line 148, column 38 in http://aspnet-scripts.telerikstatic.com/ajaxz/2013.2.717/Grid/GridBatchEditingScripts.js

0x800a138f - Microsoft JScript runtime error: Unable to get value of the property '_data': object is null or undefined

<telerik:RadGrid ID="dgCompGrid" runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False" BorderStyle="Solid" CellSpacing="0" GridLines="None" Skin="Sitefinity" Width="100%">
                                                    <ExportSettings>
                                                        <Pdf>
                                                            <PageHeader>
                                                                <LeftCell Text="" />
                                                                <MiddleCell Text="" />
                                                                <RightCell Text="" />
                                                            </PageHeader>
                                                            <PageFooter>
                                                                <LeftCell Text="" />
                                                                <MiddleCell Text="" />
                                                                <RightCell Text="" />
                                                            </PageFooter>
                                                        </Pdf>
                                                    </ExportSettings>
                                                    <ClientSettings>
                                                        <Selecting AllowRowSelect="True" />
                                                    </ClientSettings>
                                                    <MasterTableView AllowNaturalSort="False" EditMode="Batch" BatchEditingSettings-OpenEditingEvent ="DblClick" >
                                                        <BatchEditingSettings EditType="Row"  />
                                                    </MasterTableView>
                                                    <MultiHeaderItemStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </telerik:RadGrid>

VB CODE BEHIND ==========================================================

 

 

 

Public Sub Load_Component_NonGrid(ByVal iCompID As Int32, Init As Boolean)

 

 

 

If iCompID > 0 Then

 

 

 

 

 

 

 

With dgCompNonGrid

 

.Columns.Clear()

.DataSource =

 

Nothing

 

 

 

 

 

.DataSource = ippService.PlanDetails(iCompID)

.MasterTableView.DataKeyNames =

 

New String() {"ippComponentID", "ippComponentSeq"}

 

 

 

End With

 

 

 

 

 

 

 

End If

 

 

 

 

 

 

 

Dim boundColumn As GridBoundColumn

 

 

 

 

 

boundColumn =

 

New GridBoundColumn()

 

dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)

 

 

With boundColumn

 

.DataField =

 

"ippComponentSrcValue"

 

 

 

 

 

.UniqueName =

 

"dgippComponentSrcValue"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.HeaderText =

 

"Value"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

.ReadOnly =

 

False

 

 

 

 

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

 

 

End With

 

 

 

 

 

boundColumn =

 

New GridBoundColumn()

 

dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)

 

 

With boundColumn

 

.DataField =

 

"ippComponentBonusPct"

 

 

 

 

 

.UniqueName =

 

"dgippComponentBonusPct"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.HeaderText =

 

"Bonus %"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

.ReadOnly =

 

False

 

 

 

 

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

 

 

End With

 

 

 

 

 

 

 

Dim oDeleteColumn As New GridButtonColumn

 

 

 

 

 

dgCompNonGrid.MasterTableView.Columns.Add(oDeleteColumn)

 

 

With oDeleteColumn

 

.UniqueName =

 

"DeleteColumn"

 

 

 

 

 

.HeaderText =

 

"Remove"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.ButtonType =

 

GridButtonColumnType.ImageButton

 

.ImageUrl =

 

"~/Images/style7/cancel.gif"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.CommandName =

 

"Delete"

 

 

 

 

 

.CommandArgument =

 

"Delete"

 

 

 

 

 

.ConfirmText =

 

"Delete this increment?"

 

 

 

 

 

.ConfirmDialogType =

 

GridConfirmDialogType.RadWindow

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

 

 

End With

 

 

 

 

 

 

 

With dgCompNonGrid.MasterTableView

 

.CommandItemDisplay =

 

GridCommandItemDisplay.Bottom

 

.BatchEditingSettings.EditType =

 

GridBatchEditingType.Row

 

.CommandItemSettings.ShowRefreshButton =

 

False

 

 

 

 

 

 

 

End With

 

 

 

 

 

 

 

End Sub

 

 

 

 



If I set the <BatchEditingSettings EditType="Cell" /> then it works but when set to row I get the error above?  Soon as I doubleClick on the row to edit.  All the data loads just fine and even the Delete works.  The Edit and Add New causes the error.  Its like it is not putting the grid into EDIT mode when I BatchEditingSettings-OpenEditingEvent ="DblClick" ?

thanks.

9 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 26 Aug 2013, 08:54 AM
Hello Stefan,

We are aware of the error and have already provided a fix for it. In order to resolve your issue you could download our latest internal build.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
0
Stefan
Top achievements
Rank 2
answered on 28 Aug 2013, 02:28 PM
I have v2013 2.717.40

Everything was working fine and now it does not.  Is this the latest version?  This maybe the version that broke it because I did update a few weeks ago and now the Batchgrid will not edit in Row mode on in Cell?

Thanks
0
Antonio Stoilkov
Telerik team
answered on 02 Sep 2013, 05:55 AM
Hi Stefan,

You are correct in your observation the issue occurs in the Service Pack release but not in the Official. However, we have fixed the issue and made it available in our internal build which you could download from the link below.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
0
Dany
Top achievements
Rank 1
answered on 20 Sep 2013, 07:21 PM
Hi,  how do we get this fix ? We are using V.2013.2.717.40

Try the suggested link but keep saying : "No internal builds for your products have been uploaded recently."

We also have this issue,  we try to implement the BatchEditing and want user the ability to use the "TAB" key on the row edited to switch from a field to another without using the mouse
0
Antonio Stoilkov
Telerik team
answered on 25 Sep 2013, 08:17 AM
Hello Dany,

The BatchEditing Keyboard Navigation which supports the TAB key is included in the internal build and in the upcoming Beta. The feature could turned on by setting the RadGrid ClientSettings AllowKeyboardNavigation to true.
<ClientSettings AllowKeyboardNavigation="true">
                 
</ClientSettings>

It seems that your product has expired and you could not download the internal builds for the current release. You could contact our Sales team in order to renew your licence and gain access to our priority support and latest releases.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
0
Tim
Top achievements
Rank 1
answered on 28 Oct 2013, 03:01 PM
I am pretty sure we're using the latest version (2013.3.1015) and the TAB key still doesn't work.  Instead, it tabs right back into the same cell.  Is there something in this markup that's not supported?  I am not doing anything in the code behind except setting the InsertTemplate of each Column to the EditTemplate (so as not to duplicate markup and forget to make changes to one and not the other).

<ClientSettings AllowKeyboardNavigation="true">
    <%--<KeyboardNavigationSettings
        AllowActiveRowCycle="false"
        AllowSubmitOnEnter="true"
        EnableKeyboardShortcuts="true"
        />--%>
    <Resizing
        AllowColumnResize="true"
        AllowResizeToFit="true"
        EnableRealTimeResize="true"
        ResizeGridOnColumnResize="true"
        />
    <Selecting AllowRowSelect="true" />
</ClientSettings>

Grid Template Cell:
<telerik:GridTemplateColumn DataField="Code" HeaderText="Code" UniqueName="Code" ColumnGroupName="grpSegment">
    <ClientItemTemplate><span>#=Code #</span></ClientItemTemplate>
    <ItemTemplate><span><%# Eval("Code") %></span></ItemTemplate>
    <EditItemTemplate>
        <table>
            <tr>
                <td>
                    <telerik:RadTextBox runat="server" ID="txtCode"
                        CausesValidation="True"
                        CssClass="data-field"
                        MaxLength="50"
                        RenderMode="Lightweight"
                        SelectionOnFocus="SelectAll"
                        ShouldResetWidthInPixels="False"
                        ValidationGroup="<%# Me.GetValidationGroup() %>"
                        Width="100%">
                    </telerik:RadTextBox>
                </td>
                <td style="width:auto;">
                    <asp:RequiredFieldValidator runat="server" ID="txtCodeRequired"
                        CssClass="validator"
                        ControlToValidate="txtCode"
                        Display="Dynamic"
                        ErrorMessage="Code required"
                        Text="*"
                        ToolTip="Required"
                        ValidationGroup="<%# Me.GetValidationGroup() %>"
                        />
                </td>
            </tr>
        </table>
    </EditItemTemplate>
    <InsertItemTemplate>
        <%-- Set in code behind --%>
    </InsertItemTemplate>
</telerik:GridTemplateColumn>
0
Antonio Stoilkov
Telerik team
answered on 31 Oct 2013, 07:24 AM
Hi Tim,

In order to resolve your issue you could use the code for the template column below. I have tested your scenario and indeed there is a problem in the batch editing navigation. The internal code searches for the next <td> element which in your case is in the same cell because you have a <table> inside your template. Additionally, I have notified our dev team so they could provide a fix for this behavior. 
<telerik:GridTemplateColumn DataField="Code" HeaderText="Code" UniqueName="Code" ColumnGroupName="grpSegment">
    <ClientItemTemplate><span>#=Code #</span></ClientItemTemplate>
    <ItemTemplate><span><%# Eval("Code") %></span></ItemTemplate>
    <EditItemTemplate>
        <telerik:RadTextBox runat="server" ID="txtCode"
            CausesValidation="True"
            CssClass="data-field"
            MaxLength="50"
            RenderMode="Lightweight"
            SelectionOnFocus="SelectAll"
            ShouldResetWidthInPixels="False"
            ValidationGroup="<%# Me.GetValidationGroup() %>"
            Width="100%">
        </telerik:RadTextBox>
        <asp:RequiredFieldValidator runat="server" ID="txtCodeRequired"
            CssClass="validator"
            ControlToValidate="txtCode"
            Display="Dynamic"
            ErrorMessage="Code required"
            Text="*"
            ToolTip="Required"
            ValidationGroup="<%# Me.GetValidationGroup() %>" />
    </EditItemTemplate>
    <InsertItemTemplate>
        <%-- Set in code behind --%>
    </InsertItemTemplate>
</telerik:GridTemplateColumn>

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
0
Tim
Top achievements
Rank 1
answered on 01 Nov 2013, 01:41 PM
Ok, knowing that I might be able to tweak the template some.  The whole reason I started using TABLE elements in the cell templates is because the Editors do not take up the full width of the cells and instead render as some short textbox (80px wide or so).  This is causes issues while resizing column headers while in edit mode because the editors do not resize as well.  The TABLE element automatically resizes and having dynamic validators allows the validators to take up space only when needed (as opposed to float:right or display:inline-block or something).

Not telling your devs how to do their work, but maybe look for the next TD element that has a certain css class?
0
Antonio Stoilkov
Telerik team
answered on 06 Nov 2013, 06:51 AM
Hello Tim,

I am happy to say we have resolved the issue and a fix will be available in the next Service Pack release which will be available in a two weeks time frame.

Thank you for the information and the additional suggestions.

Regards,
Antonio Stoilkov
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Stefan
Top achievements
Rank 2
Answers by
Antonio Stoilkov
Telerik team
Stefan
Top achievements
Rank 2
Dany
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Share this question
or