Find DataFormField

6 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 15 May 2013 Link to this post

    Hi,

    how to find a DataFormField  <telerik:DataFormComboxField> on EditEnded?
    I have to Change the value by code and have to find this field!

    Thanks
    Best Regards
    Rene
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 17 May 2013 Link to this post

    Hello,

     You can use ChildrenOfType<DataFormDataField>(). It is an extension method to DependencyObject and it is located in the Telerik.Windows.Controls namespace, Telerik.Windows.Controls assembly.

    Greetings,
    Ivan Ivanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 22 May 2013 Link to this post

    Hi,

    I tried this, but without any success:
    SelectedValuePath="ID" DisplayMemberPath="Name" DataMemberBinding="{Binding Staat, Mode=TwoWay}" Grid.Row="5" Padding="0" Margin="0,5,0,5" Width="350" Name="Staat1_cbx"
                                                                      ItemsSource="{Binding Country, Source={StaticResource Test}}" Label="{Binding Source={StaticResource Lang}, XPath=KundenStaat/@Header}" telerik:StyleManager.Theme="Windows8"  />

    var TEST= this.KundenKontaktForm.ChildrenOfType<DataFormComboBoxField>().FirstOrDefault(t => t.Name == "Staat1_cbx");

    Test is null! why?
    Thanks
    best Regards
    Rene

  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 22 May 2013 Link to this post

    Hi,

    Is this ComboBoxFileld defined in the EditTemplate? If so, it is not yet loaded at this point. Try invoking the retrieving logic through a dispatcher.

    Regards,
    Ivan Ivanov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 22 May 2013 Link to this post

    Hi,

    it is loaded, because i try to get this Field on EditEnded of my DataForm. I Change the item in the
    combobox and press OK in my DataForm. Than i try to get this Field, but it is null, what ever
    i do.

    Ok i think i have the Problem. If i use the same Template for "ReadOnlyTemplate" and "EditTemplate", it
    works fine. But if i use a different Template for Editmode the Field is null.

    Thanks
    rene

     

  7. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 22 May 2013 Link to this post

    Hello,

     Can you please send us a sample project that illustrates your scenario? We will debug it and send you a modified version back.

    Regards,
    Ivan Ivanov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready