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

find a control in edit form template from outside radgrid

1 Answer 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morgan
Top achievements
Rank 2
Morgan asked on 19 Sep 2012, 04:26 AM
I have a radgrid with a combobox contained in an edit form template.  On opening up a jquery popup I want to populate that combobox using a radgrid selectedindexchanged event. 

I cannot get a reference to the item being edited, I have managed to use:
GridEditFormItem item = RadGrid2.MasterTableView.GetItems(GridItemType.EditFormItem)[0] as GridEditFormItem;
which gets me the first item being edited if its open, but no other items - I get a null object reference.  I believe its due to the [0] index. 
Is there a way to traverse the radgrid to find which item is currently being edited and access the Edit Form template that way?

I have tried:
foreach(GridDataItem gri in RadGrid2.EditItems)

which was suggested by another user but no good.

thanks.

1 Answer, 1 is accepted

Sort by
0
Morgan
Top achievements
Rank 2
answered on 19 Sep 2012, 05:06 AM
Its not the the most efficient fix I'm sure - but solved by passing the itemindex of the row being edited to a hiddenfield in the dialog which I used as the index for locating the grideditformitem and accessed it this way:
GridEditFormItem item = RadGrid2.MasterTableView.GetItems(GridItemType.EditFormItem)[int.Parse(HiddenField2.Value)] as GridEditFormItem;
Tags
Grid
Asked by
Morgan
Top achievements
Rank 2
Answers by
Morgan
Top achievements
Rank 2
Share this question
or