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

Editor cannot be initialized for column:

3 Answers 424 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 27 Jun 2011, 05:43 PM
We are programmatically creating the grid in the code base.

We have added a DateTime column in the Grid by the following way

  public GridDateTimeColumn AddGridDateTimeColumn(string columnHeader,string columnDataField,string uniqueName,string formatString,double percentWidth,bool readOnly,bool visible)
        {
            GridDateTimeColumn dateTimeColumn = new GridDateTimeColumn
                                                    {
                                                        HeaderText       = columnHeader,
                                                        DataField        = columnDataField,
                                                        UniqueName       = uniqueName,
                                                        ReadOnly         = readOnly,
                                                        Visible          = visible,
                                                        DataFormatString = formatString,
                                                        PickerType       =  GridDateTimeColumnPickerType.DatePicker,
                                                        DataType         =  typeof(DateTime)
                                                    };
            dateTimeColumn.ItemStyle.Width = Unit.Percentage(percentWidth);
 
            TelerikGrid.MasterTableView.Columns.Add(dateTimeColumn);
            return dateTimeColumn;
        }


When we click on Edit button on the row of the Grid.

I am trying to fetch the GridDateTimeColumnEditor by the following line of code

GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;

if (!(e.Item is GridEditFormInsertItem))
{
GridDateTimeColumnEditor dateTimeEditor = editMan.GetColumnEditor("StatementEndDateUniqueName"as GridDateTimeColumnEditor;
} The GetColumnEditor method throws error Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Editor cannot be initialized for column: StatementEndDateUniqueName The StatementEndDateUniqueName is valid. I am able to view the data , but while in Edit Mode, I get the error. Can someone help me with this? Thanks, Sunil Dixit

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 29 Jun 2011, 12:14 PM
Hi Sunil,

This might be happening if you are not creating your grid correctly in code behind. Take a look at the following article, see which scenario applies to your grid and inspect the samples to see if you follow their logic and order of execution:
Programmatic creation

Best wishes,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Sunil
Top achievements
Rank 1
answered on 29 Jun 2011, 12:15 PM
The same code works when run with Visual Studio Development Server.

But, it's working with IIS7. My web site is running under classic mode in IIS7

What can be the issue?
0
Tsvetina
Telerik team
answered on 30 Jun 2011, 02:49 PM
Hello Sunil,

Do you mean that the site is working fine on your dev machine but throws the exception only in production? If so, can you confirm that your local server and the deployment one use one and the same version of Telerik.Web.UI? Also, can you temporarily turn off AJAX to trace where exactly the exception is thrown and let us know about any further details?
Greetings,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Sunil
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Sunil
Top achievements
Rank 1
Share this question
or