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

Focus when Cancel is clicked on dataform

3 Answers 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sumati
Top achievements
Rank 1
Sumati asked on 02 Jul 2010, 06:24 AM
Hi,

I have a dataform with few controls, Commit and Cancel button.

Now user can type data in textboxes. If user click's on cancel button then the focus is not back on the last edited control
Infact focus is nowhere. User has to click on dataform to get a focus on last edited control.

How can I make it that when 'Cancel' action is done then focus should be on last edited control?

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 02 Jul 2010, 06:56 AM
Hi Sumati,

Is this DataForm somehow related to RadGridView?


Kind regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sumati
Top achievements
Rank 1
answered on 02 Jul 2010, 07:11 AM
No its a simple dataform with 3 textboxes, 6 drop downs, Commit button and Cancel button
0
Sumati
Top achievements
Rank 1
answered on 02 Jul 2010, 07:19 AM
Following is the code for reference:

void

 

Form_EditEnding(object sender, DataFormEditEndingEventArgs e)

 

{

 

    if (e.EditAction == DataFormEditAction.Cancel)

 

    {

 

        if (MessageBoxResult.Cancel == MessageBox.Show("Are you sure you want to Cancel? \nClick OK
to proceed or Cancel to return"
, "Confirm", MessageBoxButton.OKCancel))

 

        e.Cancel =

true;

 

    }

}

When e.Cancel = true; is executed then I want focus on last edited control but is is not happening
Even if I explicity write code to focus control then also it is not working

Tags
General Discussions
Asked by
Sumati
Top achievements
Rank 1
Answers by
Milan
Telerik team
Sumati
Top achievements
Rank 1
Share this question
or