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

Problem with GridTemplateColumn

2 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Leonardo Amorim de Barros
Top achievements
Rank 1
Leonardo Amorim de Barros asked on 21 Aug 2008, 08:35 PM
I'm creating columns programmatically and some columns are GridTemplateColumns.

I created a class inherited from ITemplate that has a RadNumericTextBox and I set the ItemTemplate property.

When I run the page, only the last row show the RadNumericTextBox control. Why?


2 Answers, 1 is accepted

Sort by
0
Leon
Top achievements
Rank 1
answered on 21 Aug 2008, 08:42 PM
Carlos,

I guess there's something missing in your implementation concerning the strict rules on creating the Grid programmatically especially in case of template columns. See the approach explained in details in the documentation here (see Creating a template columns dynamically).

By the way, have you tried the built-in GridNumericColumn? You can skip the template columns this way. See the Column Types demo with the numeric column on the second Grid:

http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/GeneralFeatures/ColumnTypes/DefaultCS.aspx

Hope that helps!
~Leon
0
Leonardo Amorim de Barros
Top achievements
Rank 1
answered on 21 Aug 2008, 09:10 PM
OK, thanks for the help.

The problem was in my class inherited from ITemplate. I was instantiated the RadNumericTextBox inside the constructor of that class, but it needed to be inside the InstantiateIn method.
Tags
Grid
Asked by
Leonardo Amorim de Barros
Top achievements
Rank 1
Answers by
Leon
Top achievements
Rank 1
Leonardo Amorim de Barros
Top achievements
Rank 1
Share this question
or