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

Focusing first element in RadDataForm

6 Answers 204 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 21 Nov 2011, 06:46 PM
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!

6 Answers, 1 is accepted

Sort by
0
Sergey
Top achievements
Rank 1
answered on 22 Nov 2011, 12:35 PM
I'm sorry for noise, but do you have any suggestions?
0
Ivan Ivanov
Telerik team
answered on 22 Nov 2011, 05:18 PM
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 >>
0
Sergey
Top achievements
Rank 1
answered on 23 Nov 2011, 09:44 AM
Hi Ivan,
It doesn't work at my PC. Also, I would like to embed DataForm in GridView.
0
Sergey
Top achievements
Rank 1
answered on 23 Nov 2011, 03:13 PM
Hello again :)
May be you know way to getting row detail object for current selected row?
0
Sergey
Top achievements
Rank 1
answered on 23 Nov 2011, 03:53 PM
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?
0
Ivan Ivanov
Telerik team
answered on 25 Nov 2011, 10:59 AM
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 >>
Tags
DataForm
Asked by
Sergey
Top achievements
Rank 1
Answers by
Sergey
Top achievements
Rank 1
Ivan Ivanov
Telerik team
Share this question
or