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

Updating a cell programatically

3 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 09 May 2008, 02:49 PM
I'm trying to update a cell in code, but get this error:
DataTable internal index is corrupted: '13'.

My code to perform the update is:
RadGridView1.Rows(rowNum).Cells(cellNum).Value = "12"

What could be going on here?  Stack trace below:
System.InvalidOperationException was unhandled
  Message="DataTable internal index is corrupted: '13'."
  Source="System.Data"
  StackTrace:
       at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex)    at System.Data.RBTree`1.get_Item(Int32 index)    at System.Data.DataView.GetRecord(Int32 recordIndex)    at System.Data.DataView.GetRow(Int32 index)    at System.Data.DataView.get_Item(Int32 recordIndex)    at Telerik.WinControls.Data.DataAccessComponent.FindRow(GridViewRowInfo rowInfo)    at Telerik.WinControls.Data.DataAccessComponent.set_Item(GridViewRowInfo row, GridViewDataColumn column, Object value)    at Telerik.WinControls.UI.GridViewTemplate.set_Item(GridViewRowInfo row, GridViewDataColumn column, Object value)    at Telerik.WinControls.UI.GridViewCellInfo.set_Value(Object value)    at ...

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 10 May 2008, 08:24 AM
Hi Bob,

We have not found issues related to updating data of RadGridView from its Rows collection. Please, send us a simple example to reproduce the issue locally. It will help us address any potential issue faster.

Thank you in advance.

Regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Prad
Top achievements
Rank 2
answered on 23 Jan 2009, 06:12 PM
 I can help you reproduce this error is by following steps.

1. Grid with column1, column2, column3. Load some values into datatable
2. Create 2 timers and see that  you start the timer when executed.
3. Timer1_Event: Update column1 rows randomly.
4. Timer2_event: Update Column2 row randomly.

 The error occurs when for a given row example row2[Column1] being edited by Timer1_event and at the same time row2[Column2] being edited by Timer2_event causes this error. This error exists from Framework 2.0.

http://support.microsoft.com/kb/932491
0
Julian Benkov
Telerik team
answered on 26 Jan 2009, 05:16 PM
Hi Pradeep,

Thank you for the good example and for your help. We highly appreciate it.

All the best,
Julian Benkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Bob
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Prad
Top achievements
Rank 2
Share this question
or