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

Disable/Enable Command Items for Edit Mode

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rory
Top achievements
Rank 1
Rory asked on 28 Apr 2008, 06:17 PM
Hi there,
In the older version of the RadGrid I was able to use this code below to Disable or Enable the commandItems inside a Nested Grid. This doesn't seem to work in the new RadGrid. I am calling this during the Grid's Prerender and it throws an error of "Index was outside the Bounds of the array."

Could this be because on preRender the Child Items are not expanded?
 

foreach (GridDataItem masterItem in policyGrid.MasterTableView.Items)   
{  
  if (masterItem.HasChildItems)   
  {  
   GridCommandItem commandItem = (GridCommandItem)masterItem.ChildItem.NestedTableViews[0].GetItems(GridItemType.CommandItem)[0];  
   commandItem.Enabled = blnEditable;  
   }  

Thanks.

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 29 Apr 2008, 12:40 PM
Hello Rory,

Attached to this message, is a sample application, which handles a similar functionality and behaves normally.
Let me know if something is different in your case.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Rory
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or