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

Problems to get control inside EditItemTemplate

0 Answers 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hector
Top achievements
Rank 1
Hector asked on 12 Apr 2017, 03:39 PM

I have a RadGrid with 5 columns and 3 of them have an ItemTemplate and EditItemTemplate, both having a control inside (Label and CheckBox, Label and RadDatePicker, Label and RadCombobox).

I have an issue when i click on the ckeckbox, i need to disable the RadDatePicker which is in another column but i cant find it.

I tried to use FindControl to search for the control that i need but always gets me the first founded and if the row that i have selected is not the first one, the control is not the one that i want.

var control = RadGrid1.FindControl(RadGrid1.MasterTableView.ClientID + "_Column3");

I tried also, browsing on the list of items that have my RadGrid and when i search for the control that i want, returns a null.
                foreach (GridDataItem item in RadGrid1.Items)
                {
                    var ctl = item.FindControl(RadGrid1.MasterTableView.ClientID + "_Column3");
                    if (ctl == null) continue;
                }

I dont know what am i doing wrong or if i am missing something but i hope that you could help me.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Hector
Top achievements
Rank 1
Share this question
or