Column Editor fails to initialize in Grid v.2013.1.220.40

10 posts, 0 answers
  1. Paul Taylor
    Paul Taylor avatar
    41 posts
    Member since:
    Jun 2010

    Posted 12 Apr 2013 Link to this post

    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?
  2. Paul Taylor
    Paul Taylor avatar
    41 posts
    Member since:
    Jun 2010

    Posted 15 Apr 2013 Link to this post

    I'd be grateful for any light you can cast on this, please.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul Taylor
    Paul Taylor avatar
    41 posts
    Member since:
    Jun 2010

    Posted 16 Apr 2013 Link to this post

    Hello, I'd be grateful for a response to this, please.
  5. Paul Taylor
    Paul Taylor avatar
    41 posts
    Member since:
    Jun 2010

    Posted 17 Apr 2013 Link to this post

    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. 
  6. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 17 Apr 2013 Link to this post

    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.
  7. Paul Taylor
    Paul Taylor avatar
    41 posts
    Member since:
    Jun 2010

    Posted 17 Apr 2013 Link to this post

    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.
  8. Sean
    Sean avatar
    19 posts
    Member since:
    Jun 2012

    Posted 22 Apr 2013 Link to this post

    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~
  9. Sean
    Sean avatar
    19 posts
    Member since:
    Jun 2012

    Posted 22 Apr 2013 Link to this post

    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~
  10. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 25 Apr 2013 Link to this post

    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.
  11. Segev
    Segev avatar
    1 posts
    Member since:
    May 2013

    Posted 05 May 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017