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

Index out of range error - no RefreshEdit()

1 Answer 97 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gone2TheDogs
Top achievements
Rank 1
Iron
Veteran
Gone2TheDogs asked on 31 Oct 2016, 04:06 PM

The original grid was a standard item grid.  After the item number was entered, I did a dgvItems.RefreshEdit() to commit the change and make the new row accessible.

The telerick datagrid does not have the RefreshEdit() function and I have not been able to find an equivalent function.  When I access e.RowIndex or dgvItems.CurrentRow.Index, it returns -1.  In addition, if I try to access the new row, I get an index out of range error.

What is the proper method for the row index so that it does not return -1.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Nov 2016, 07:41 AM
Hi Bob,

Thank you for writing.

You can set the AddNewBoundRowBeforeEdit property in order to add the new row to the underlying data source directly. Detailed information is available here: New Row.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
GridView
Asked by
Gone2TheDogs
Top achievements
Rank 1
Iron
Veteran
Answers by
Dimitar
Telerik team
Share this question
or