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

GridNumericColumnEditor throwing ArgumentOutOfRangeException error

5 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 04 Dec 2010, 02:41 PM
We have a grid that uses a series of numeric columns. For consistency, the developer was attempting to use a GridNumericColumnEditor; this works properly when it's applied to a single column, but when it's applied to more than one column the page throws a ArgumentOutOfRangeException when attempting to edit.

The column editor is defined as;

   
<telerik:GridNumericColumnEditor ID="customNumeric" runat="server"><br>
        <NumericTextBox Width="70" /><br>
    </telerik:GridNumericColumnEditor>


...and the Grid columns are defined as;

                            <
telerik:GridNumericColumn DataField="Area1" DataType="System.Decimal" HeaderText="Area1"<br>
                                SortExpression="Area1" UniqueName="Area1" NumericType="Currency" DataFormatString="{0:c2}"<br>
                                Aggregate="Sum" ColumnEditorID="customNumeric"><br>
                            </telerik:GridNumericColumn><br>
                            <telerik:GridNumericColumn DataField="Area2" DataType="System.Decimal" HeaderText="Area2"<br>
                                SortExpression="Area2" UniqueName="Area2" NumericType="Currency" DataFormatString="{0:c2}"<br>
                                Aggregate="Sum" ColumnEditorID="customNumeric"><br>
                            </telerik:GridNumericColumn>


If we have the ColumnEditorID set in only one column (any column) it works, but when it's added to the second or subsequent column it throws the error. Is there something we're missing?

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Dec 2010, 06:24 AM
Hello Derek,

You need to use separate GridNumericColumnEditor for each NumericColumn in grid. There is one forum which discusses the similar scenario. Please go through the following forum.
Error on GridNumericColumn when using ColumnEditorID

Thanks,
Princy.
0
Derek
Top achievements
Rank 1
answered on 06 Dec 2010, 01:09 PM
Thank you for the answer, but this seems inconsistent with the other column editors. We have placed GridTextBoxColumnEditors and GridDropDownListColumnEditors and used them on multiple columns, and it seems to work fine.

From my perspective one of the key reasons to use column editors is to ensure consistency in data entry fields; change the column editor settings and every column that uses that column editor will be updated accordingly. That functionality is lost if you have to create a unique column editor for each column; if that were the case why not use template columns?

Am I missing something here?
0
Veli
Telerik team
answered on 09 Dec 2010, 04:22 PM
Hello Derek,

Sharing column editors for multiple columns is not a supported scenario. While it may work for some cases with the GridTextBoxColumnEditor, it is not expected to work in any scenario. You need to use separate editor declarations for every column. Also note that declarative column editors are provided only for styling pursposes. Their non-style related properties are not guaranteed to work either.

Veli
the Telerik team
Browse the vast support resources we have to jumpstart 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
Derek
Top achievements
Rank 1
answered on 09 Dec 2010, 05:23 PM
Thanks for the answer. It appears we misunderstood the functionality and have regularly used GridTextBoxColumnEditors and GridDropDownColumnEditors for multiple columns.

With that in mind, I'd suggest that this behaviour be preserved since it provides a valuable feature. On some forms we were using the column editors to control and manage appearance; set the width of the text column editor, for example, and all text boxes would use the new width, and so on. While apparently it wasn't the intention, it *is* very useful.

On the form in which we were trying to use numeric column editors, we have a series of values, and want each one to take the same format, width, etc. Using a single column editor would have been valuable, both in design and maintenance.

If each column requires a dedicated column editor, you'd lose that benefit, and I'm not sure why there would be any reason to use a column editor over a template column.
0
Veli
Telerik team
answered on 10 Dec 2010, 12:45 PM
As I mentioned in my previous post, declarative column editors are provided for styling purposes only. This means a column editor can be styled intuitively through the markup, and, even more conveniently, be defined an a .skin file. It is not meant as a settings container to copy functional settings for the actual column editors from.

This being said, we have noted your feedback on sharing common editors for multiple columns being useful. Our dev team has been notified of your comment.

Greetings,
Veli
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
Derek
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Derek
Top achievements
Rank 1
Veli
Telerik team
Share this question
or