Focusing first element in RadDataForm

7 posts, 0 answers
  1. Sergey
    Sergey avatar
    21 posts
    Member since:
    Aug 2012

    Posted 21 Nov 2011 Link to this post

    Hello!
    I use RadDataForm and RadGridView together such as in this demo.
    It works fine, but I need to focus first element of Data Form after row selection.
    I've studied your API reference, but can't find any way to solve my problem.
    Any suggestions about it?
    Thank you!
  2. Sergey
    Sergey avatar
    21 posts
    Member since:
    Aug 2012

    Posted 22 Nov 2011 Link to this post

    I'm sorry for noise, but do you have any suggestions?
  3. DevCraft banner
  4. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 22 Nov 2011 Link to this post

    Hi Sergey,

    I have prepared an example project that illustrates a possible approach to such a scenario. I am attaching it for your reference.
     
    Best wishes,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  5. Sergey
    Sergey avatar
    21 posts
    Member since:
    Aug 2012

    Posted 23 Nov 2011 Link to this post

    Hi Ivan,
    It doesn't work at my PC. Also, I would like to embed DataForm in GridView.
  6. Sergey
    Sergey avatar
    21 posts
    Member since:
    Aug 2012

    Posted 23 Nov 2011 Link to this post

    Hello again :)
    May be you know way to getting row detail object for current selected row?
  7. Sergey
    Sergey avatar
    21 posts
    Member since:
    Aug 2012

    Posted 23 Nov 2011 Link to this post

    Hello again and again :)
    I've found way to get moment when RowDetails shows - RadGridView.RowDetailsVisibilityChanged.
    Now I would like to get controls insed RadDataForm. I tried to use your code, but it doesn't work:
    dataForm.ChildrenOfType<DataFormDataField>().First()
                        .ChildrenOfType<TextBox>().First()
                        .Focus();

    It throws exception on first .First() call.
    Can you sugges any way to enumerating inside controls of RadDataForm?
  8. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 25 Nov 2011 Link to this post

    Hi Sergey,

    At that point RadDataForm's fields may not be loaded into the visual tree yet. In order to use this code successfully, you may try invoking it with Dispatcher. However, I have prepared a sample project for you that illustrates a possible way to achieving this. I am attaching it for your reference.

    All the best,
    Ivan Ivanov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top
DevCraft banner