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

Inheriting grid columns - paging error

3 Answers 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Polina
Top achievements
Rank 1
Polina asked on 19 Nov 2008, 07:04 PM
Hello
I am running into the technical issue trying to use the latest  version (Q2 2008) Rad Grid ASP.NET in our application
I am building module that generates columns of the gird in the code behind (on page load event). I am also using built in paging, filtering and sorting on the grid
everything works fine until i try to add a custom column (inherited from the GridBound column)
the column does get rendered in the grid but when i try any further actions such as paging, sorting and filtering they are stopped by the following error
Cannot create column with the specified type name: TestColumn
My TestColumn has currently no implementation in it besides being derived from GridBoundColumn as following:

 public class TestColumn : GridBoundColumn
    {   
        public override GridColumn Clone()
        {
            return base.Clone();
        }

        public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem)
        {
            base.InitializeCell(cell, columnIndex, inItem);
        }
    }

3 Answers, 1 is accepted

Sort by
0
Polina
Top achievements
Rank 1
answered on 19 Nov 2008, 09:23 PM
I have done some more testing - and it only happens when trying to add a column programmatically.
if the same type of column is added in the markup everything works fine


0
Paul
Telerik team
answered on 20 Nov 2008, 09:20 AM
Hello Polina,

When you create custom columns (which derive from built-in RadGrid columns), you need to intercept the ColumnCreating event in order to recreate those columns on each submit action. Thus the columns should be recognized and displayed in the control as expected.

Review the ColumnCreating handler of the following online demo for more details:
http://demos.telerik.com/ASPNET/Prometheus/Controls/Examples/Integration/GridAndCombo/DefaultCS.aspx?product=grid

Greetings,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Polina
Top achievements
Rank 1
answered on 20 Nov 2008, 03:32 PM
Thanks
this fixed the problem
Tags
Grid
Asked by
Polina
Top achievements
Rank 1
Answers by
Polina
Top achievements
Rank 1
Paul
Telerik team
Share this question
or