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

[Solved] Error on GridNumericColumn when using ColumnEditorID

4 Answers 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 05 Feb 2010, 08:28 PM
I have several columns in my grid that are not working properly. When I add a ColumnEditorID my application throws an error when I try to enter edit mode. I do have one column that is of type GridNumericColumn that does have a ColumnEditorID assigned that is working (I'm trying to use the same one). They are both of type money in the database. The only difference between the two is the one that does not work comes through a view while the one that does work is pulled straight from a table.

Error Message:
Source: System.Web  
Message: Specified argument was out of the range of valid values. Parameter name: index  
Stack trace: at System.Web.UI.ControlCollection.get_Item(Int32 index) at Telerik.Web.UI.GridNumericColumnEditor.LoadControlsFromContainer() at Telerik.Web.UI.GridColumnEditorBase.InitializeFromControl(Control containerControl) at Telerik.Web.UI.GridBoundColumn.OnDataBindColumn(Object sender, EventArgs e) at System.Web.UI.Control.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) at Telerik.Web.UI.GridItemBuilder.InitializeItem(Int32 dataSourceIndex, String& nextItemHierarchicalIndex, Boolean& itemIsInEditMode) at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.GridTableView.Rebind() at Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) at Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)   
 
Column:
<telerik:GridNumericColumn   
   DataField="SellerPaidBuyerCost"   
   DataFormatString="{0:C}" 
   HeaderText="Seller Paid Buyer Cost"   
   UniqueName="SellerPaidBuyerCost">  
   <HeaderStyle  HorizontalAlign="Center" Width="100px"></HeaderStyle> 
   <ItemStyle HorizontalAlign="Right"></ItemStyle> 
</telerik:GridNumericColumn> 
GridNumericColumnEditor:
<telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" NumericTextBox-EnabledStyle-HorizontalAlign="Right" runat="server" NumericTextBox-Width="75px">  
    <NumericTextBox runat="server">  
        <NumberFormat DecimalDigits="2" /> 
     </NumericTextBox> 
</telerik:GridNumericColumnEditor> 

4 Answers, 1 is accepted

Sort by
0
Aaron
Top achievements
Rank 1
answered on 05 Feb 2010, 09:05 PM
ok, I found a way to make this work. Please tell me if this is a feature or a bug.

I added a seperate telerik:GridNumericColumnEditor for each column in my grid needs one.
0
Yavor
Telerik team
answered on 11 Feb 2010, 06:29 AM
Hello Aaron,

Can you please supply some additional information on the setup. How is the control bound. What sre the declarations of the working and non working columns and column editors. Any additonal information will help us better address the question at hand.

Best wishes,
Yavor
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Aaron
Top achievements
Rank 1
answered on 12 Feb 2010, 11:45 PM
The radgrid is bound to an ObjectDataSource that returns a datatable. The datatable is populated from a stored procedure that joins 19 tables and 3 views. The declarations of the working and non working columns where identical, but they where all trying to use the same column editor.
0
Iana Tsolova
Telerik team
answered on 18 Feb 2010, 06:51 AM
Hello Aaron,

I am afraid that sharing column editors between columns is not supported. You need to add different column editors for each column.

Sincerely yours,
Iana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 1
Yavor
Telerik team
Iana Tsolova
Telerik team
Share this question
or