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

RadGridView AllowAddNewRow Error

2 Answers 174 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Juan Antonio
Top achievements
Rank 1
Juan Antonio asked on 08 Oct 2010, 07:26 PM
Hello,

I´m traying to use the AllowAddNewRow property of RadGridView but
i have an error when set to true this property.

The error ocurrs when you configures the grid with readonly columns property.
When you drag and drop the "Click here to add new row" cell to other readonly cell in diferent row.

this is my example

GridViewTextBoxColumn

 

txtEstatus = new GridViewTextBoxColumn();

 

txtEstatus.Name =

"Estatus";

 

txtEstatus.HeaderText =

"Estatus";

 

txtEstatus.ReadOnly =

true;

 

radGridView1.Columns.Add(txtEstatus);

 


GridViewTextBoxColumn
txtot = new GridViewTextBoxColumn();

 

txtot.Name =

"OT";

 

txtot.ReadOnly =

true;

 

txtot.HeaderText =

"OT";

 

radGridView1.Columns.Add(txtot);

radGridView1.AllowAddNewRow =

true;

 

radGridView1.AutoSizeColumnsMode =

GridViewAutoSizeColumnsMode.Fill;

 

radGridView1.Rows.Add((

new List<string> {"333","333","dd","dd" }).ToArray());

 



to resolve this error i have to set each cell for this row to readonly




The error says Message= "No se puede convertir un objeto de tipo 'Telerik.WinControls.UI.GridViewDataRowInfo' al tipo 'Telerik.WinControls.UI.GridViewNewRowInfo'.

"Unable to cast object of type 'Telerik.WinControls.UI.GridViewDataRowInfo' to type 'Telerik.WinControls.UI.GridViewNewRowInfo'.

2 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 08 Oct 2010, 11:25 PM
Hello Juan,

I cannot replicate this exception, i have set the AllowAddNewRow property to true, and everything you said, but you shouldn't be able to drag the Row dedicated to creating a new row and in the Q2 2010 version i am using I could not manage to do that.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Alexander
Telerik team
answered on 14 Oct 2010, 08:36 AM
Hello Juan,

Thank you for your question.

As Emanuel stated, the RadGridView control does not allow drag-drop of new row cells. The actual reason for the exception you receive is in a different part of your project. If you still cannot resolve it, please create a support ticket and attach your project to it. It will help us to investigate this issue further.

I am looking forward to your reply.

Kind regards,
Alexander
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
GridView
Asked by
Juan Antonio
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or