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

Column Editor fails to initialize in Grid v.2013.1.220.40

9 Answers 330 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Taylor
Top achievements
Rank 1
Paul Taylor asked on 12 Apr 2013, 11:50 AM
I have a DotNetNuke module that uses a RadGrid with InPlace editing. Markup follows:

        <telerik:RadGrid ID="lstInstallations" runat="server" AutoGenerateColumns="false"
            AllowPaging="true" OnNeedDataSource="lstInstallations_NeedDataSource" OnInsertCommand="lstInstallations_InsertCommand"
            OnUpdateCommand="lstInstallations_UpdateCommand" OnDeleteCommand="lstInstallations_DeleteCommand"
            OnItemCreated="lstInstallations_ItemCreated" CssClass="installation-table">
            <MasterTableView EditMode="InPlace" DataKeyNames="InstallationId" CommandItemDisplay="Bottom">
                <Columns>
                    <telerik:GridEditCommandColumn UniqueName="Edit" ItemStyle-CssClass="command-column" />
                    <telerik:GridButtonColumn CommandName="Delete" UniqueName="DeleteInstallation" ItemStyle-CssClass="command-column" />
                    <telerik:GridBoundColumn DataField="Domain" UniqueName="Domain" />
                </Columns>
            </MasterTableView>
            <ValidationSettings ValidationGroup="Installations" />
        </telerik:RadGrid>

This code worked correctly for AJAX controls for DotNetNuke v.2012.3.1205.40, but in v.2013.1.220.40, the behaviour has changed. The grid does not show a text box for the Domain column when it enters Insert mode. If you click the Insert link, it correctly shows a validation message saying that the field is required, and then gives the expected text box. If you then enter a value and click the Insert link again, you get the following error:

Editor cannot be initialized for column: Domain ---> Telerik.Web.UI.GridColumnEditorException: Editor cannot be initialized for column: Domain at Telerik.Web.UI.GridEditManager.GetColumnEditor(IGridEditableColumn column) at Telerik.Web.UI.GridBoundColumn.FillValues(IDictionary newValues, GridEditableItem editableItem) at Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues) at Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem)

This appears to be a bug. Is there a fix for it, or a workaround, please?

9 Answers, 1 is accepted

Sort by
0
Paul Taylor
Top achievements
Rank 1
answered on 15 Apr 2013, 12:50 PM
I'd be grateful for any light you can cast on this, please.
0
Paul Taylor
Top achievements
Rank 1
answered on 16 Apr 2013, 05:28 PM
Hello, I'd be grateful for a response to this, please.
0
Paul Taylor
Top achievements
Rank 1
answered on 17 Apr 2013, 09:19 AM
This post is 5 days old and has not received a response. The bug in question is causing frustration among users of my application as it has broken an important feature in it. Please can you respond to this thread, even if only to tell me that you need more information. Otherwise please tell me how I can escalate it. 
0
Eyup
Telerik team
answered on 17 Apr 2013, 11:05 AM
Hi Paul,

I understand your frustration, however, please note that we are not providing a strict hour-based support for our forums. You can refer to our 24-hour support policy when using the support tickets system:
http://www.telerik.com/purchase.aspx

As for the observed issue, I am afraid we are not able to replicate it locally. Please verify that you are not setting the ColumnEditorID or disabling the Visible property of the column dynamically. 

Please provide us the exact steps to reproduce the issue or open a support ticket to send us a sample runnable application demonstrating the erratic behavior. Thus, we will be able to further debug and analyze the project and provide a proper solution.

All the best,
Eyup
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.
0
Paul Taylor
Top achievements
Rank 1
answered on 17 Apr 2013, 03:17 PM
Thank you. Code in the ItemCreated event was setting the editor's TextBoxControl.ID property, and that is what caused the exception in this version of the controls.
0
Sean
Top achievements
Rank 2
answered on 22 Apr 2013, 04:07 PM
I am having the same issue in my application. I went to add a new column and started getting an error with one of the original columns. I am dynamically adding a required field validator in my code-behind and call it through the ItemCreated event as such:

                         var validator = new RequiredFieldValidator();
                   switch (column.ColumnType)
                   {
                       case "GridBoundColumn":                          
                               var gbeditor =
                                   (GridTextBoxColumnEditor) item.EditManager.GetColumnEditor(column.UniqueName);
                               cell = (TableCell) gbeditor.TextBoxControl.Parent;
                               gbeditor.TextBoxControl.ID = "txt" + column.UniqueName;
                               validator.ControlToValidate = gbeditor.TextBoxControl.ID;
                               validator.ErrorMessage = " *";
                               validator.ValidationGroup = "AnimalGroup";
                               validator.Enabled = true;
                               validator.ForeColor = Color.Red;
                               validator.Font.Bold = true;
                               cell.Controls.Add(validator);
                           break;
                       case "GridTemplateColumn":
                           break;
                       case "GridDropDownColumn":
                           var gdeditor = (GridDropDownListColumnEditor)item.EditManager.GetColumnEditor(column.UniqueName);
                           cell = (TableCell)gdeditor.ComboBoxControl.Parent;
                           validator.ControlToValidate = gdeditor.ComboBoxControl.ID;
                           validator.ErrorMessage = " *";
                           validator.ValidationGroup = "AnimalGroup";
                           validator.Enabled = true;
                           validator.ForeColor = Color.Red;
                           validator.Font.Bold = true;
                           cell.Controls.Add(validator);
                           break;                    
                   }

Every thing works fine in my previously released version, but now I am getting the following error:
Telerik.Web.UI.GridColumnEditorException: Editor cannot be initialized for column: AnimalName

Animal name is a GridBoundColumn and has not given me any issues until now.

Sean~
0
Sean
Top achievements
Rank 2
answered on 22 Apr 2013, 04:28 PM
Interestingly, when I removed the line of code that set the textbox ID to something custom, instead of letting it keep the default TB_[ColumnName], it works fine...

Strange, IMO. There are no other controls on the page with that name, so why would there be an issue?

My ID: txtAnimalName
Telerik ID: TB_AnimalName

Sean~
0
Eyup
Telerik team
answered on 25 Apr 2013, 08:28 AM
Hi Sean,

In the newer versions of RadControls, RadGrid generated this ID automatically and uses it for internal logic later on. Therefore, you need to stick with the autogenerated ID.

We will update the Validation help topic accordingly.

Please excuse us for any inconvenience caused. 

All the best,
Eyup
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.
0
Segev
Top achievements
Rank 1
answered on 05 May 2013, 10:50 AM
Hi,

I had the same problem.
I suggest you to use the Attributes property, and not the ID.

Instead of (for example):
textBox.ID += column.UniqueName;


You can do this:
textBox.Attributes.Add("columnUniqueName", column.UniqueName);


Good luck.
Tags
Grid
Asked by
Paul Taylor
Top achievements
Rank 1
Answers by
Paul Taylor
Top achievements
Rank 1
Eyup
Telerik team
Sean
Top achievements
Rank 2
Segev
Top achievements
Rank 1
Share this question
or