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

How to get "PART_CommitButton" Button?

1 Answer 18 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Zhang
Top achievements
Rank 1
Zhang asked on 02 Jan 2014, 10:23 AM
For using Commands with DataForm, i need references of buttons which with a "PART_" prefix.
Find DataForm.FindName("PART_CommitButton")" returns null. Is there any way?

1 Answer, 1 is accepted

Sort by
0
Zhang
Top achievements
Rank 1
answered on 02 Jan 2014, 04:35 PM
I found the way. The code snippet as follows and must be placed at loaded event:
                
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            var btns = DataForm1.ChildrenOfType<RadButton>();
            var btnCommit = btns.Single(x => x.Name == "PART_CommitButton");
            btnCommit.Command = CommitCommand;     
        }
Tags
DataForm
Asked by
Zhang
Top achievements
Rank 1
Answers by
Zhang
Top achievements
Rank 1
Share this question
or