Hi Telerik,
I have a Radgrid with EditForm of type "Template".
On Server side at one point I need to traverse through all controls inside the Edit Form template and their values.
Usually to get a reference to a control I do something like:
Since, I need to reference all of the controls this time I tried to do the following:
But this did not work, because Controls collection returns only EditFormTableCell control(s).
So the question is how can I Loop through all editable controls inside Edit Form template and set their values.
I have a Radgrid with EditForm of type "Template".
On Server side at one point I need to traverse through all controls inside the Edit Form template and their values.
Usually to get a reference to a control I do something like:
| RadComboBox cntrlDDLhippingAccountType = null; |
| cntrlDDLhippingAccountType = (RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]).FindControl("ddlID") as RadComboBox; |
| foreach (Control c in (RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[0]).Controls) |
| { |
| if (c is RadInputControl) |
| { |
| ((RadInputControl)c).Text = String.Empty; |
| } |
| else if (c is RadComboBox) |
| { |
| ((RadComboBox)c).SelectedIndex = 0; |
| } |
| } |
But this did not work, because Controls collection returns only EditFormTableCell control(s).
So the question is how can I Loop through all editable controls inside Edit Form template and set their values.