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

Accessing Controls in RadTabControl in a RadDataForm

0 Answers 80 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Almond
Top achievements
Rank 1
Almond asked on 08 Sep 2012, 02:58 AM
Dear Telerik Gurus,

Good morning.

I would like to ask how can i possibly access the controls inside a RadTabControl and RadTabItem inside a RadDataForm

I am trying to access them with the code below:

Type_Hldr = tbl_contractsRadDataForm.ChildrenOfType<RadMaskedTextBox>().Where(o => o.Name == "service_typeTextBox").First();

If the control is outside the tabcontrol, I can successfully access the control, however if the controls are inside the tabs, i am getting the below error:

Sequence contains no elements

with the following details:

{System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at csis.Views.ContractList.tbl_contractsRadDataForm_Loaded(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)}

Can anyone point me out on how to fix my problem?

I am trying to access the controls in the tabcontrols in the loaded event of the form.

Thanks in advance.

almond
a telerik newbie :D

Tags
TabControl
Asked by
Almond
Top achievements
Rank 1
Share this question
or