This is a migrated thread and some comments may be shown as answers.
enumeration operation may not execute
1 Answer 17 Views
This is a migrated thread and some comments may be shown as answers.
Lee Malo
Top achievements
Rank 1
Lee Malo asked on 20 Apr 2010, 07:22 PM
I have the following code on item command

 

protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

if (e.CommandName == RadGrid.InitInsertCommandName)

 

{

 

// cancel the default operation

 

e.Canceled =

true;

 

 

//Prepare an IDictionary with the predefined values

 

System.Collections.Specialized.

ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

 

 

//set default checked state for the checkbox inside the EditItemTemplate

 

newValues[

"SET0"] = false;

 

 

//Insert the item and rebind

 

e.Item.OwnerTableView.InsertItem(newValues);

}

}

This sets the dafault value of a checkbox to false on an insert.
When there is data in the table already this works but if the table is empty I get
"Sys.WebForms.PageRequestManagerServerErrorException: Collection was modified; enumeration operation may not execute."
any suggestions?

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 21 Apr 2010, 11:22 AM
Hello Lee,

I am afraid that we are not aware of such error. Can you please provide more information like how you are binding RadGrid etc. Thus we'll be able to assist you further.

Regards,
Nikolay
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
Lee Malo
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or