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

Firing Update from Outside RadGrid

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John Rogowski
Top achievements
Rank 1
John Rogowski asked on 26 Jan 2009, 04:17 PM
I've been trying the FireCommandEvent() to post grid updates from outside the grid (via "Save" button).  Some of my grids are using InPlace mode, and others using EditForm.  For the those using InLine, I've been able to iterate through the EditItems collection and fire the event successfully.  Unfortunately, the EditItems collection does not contain EditFormItem is not accessible for items in the EditItems collection.  In the meantime, I've been able to cast it as GridDataItem and access the EditFormItem for firing the event.

for(int i=0; i < this.RadGrid1.EditItems.Count; i++)
{
  (this.RadGrid1.EditItems[i] as GridDataItem).EditFormItem.FireCommandEvent(RadGrid.UpdateCommandName, String.Empty);
}

It's not the most elegant solution, but it works.  Is that something that'll be available eventually?

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 29 Jan 2009, 04:20 PM
Hello John,

It's possible to access EditForm items from MasterTableView as shown below:
GridItem[] items = RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem); 
if (items.Length > 0) 
    foreach (GridItem item in items) 
        //your code -> you can cast it as GridEditFormItem 

Let me know if I'm missing something.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
John Rogowski
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or