Accessing Controls in RadTabControl in a RadDataForm

1 posts, 0 answers
  1. Almond
    Almond avatar
    43 posts
    Member since:
    Feb 2011

    Posted 07 Sep 2012 Link to this post

    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

Back to Top