GridNumericColumnEditor throwing ArgumentOutOfRangeException error

6 posts, 0 answers
  1. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 04 Dec 2010 Link to this post

    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?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 06 Dec 2010 Link to this post

    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?
  5. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 09 Dec 2010 Link to this post

    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.
  6. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 09 Dec 2010 Link to this post

    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.
  7. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 10 Dec 2010 Link to this post

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