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

RadWindow Default Button

1 Answer 163 Views
Window
This is a migrated thread and some comments may be shown as answers.
BrianS
Top achievements
Rank 1
BrianS asked on 10 May 2011, 09:39 PM
My user control is displayed in a radwindow declared in page1. The web user control contains an asp:panel with it's defaultbutton set to a button on the web user control. Page1 also has a submit button.

If the radwindow content is focused, and I press enter, the button in the web user control works as expected.

If i click the radwindow's title bar or icon, the button in page1 is invoked; this is not desired.

As long as the window is displayed, only the web user control button should work.

<telerik:RadWindow ID="radWinAccountSearch" runat="server" Title="Account Search" Behaviors="Move, Reload" VisibleStatusbar="false" >
    <ContentTemplate>
        <ucAccountSearch:AccountSearch ID="AccountSearchControl" runat="server" OnAccountsSelected="AccountSearchControl_AccountsSelected" />
   </ContentTemplate>
</telerik:RadWindow>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 May 2011, 11:37 AM

Hello Brian,

I am not sure what your exact setup is, but please note that the RadWindow is a part of the main page and thus if the form has a default button set it will take precedence when the titlebar is focued (and not the panel inside).

What I can suggest is that when the RadWindow is shown you make the default button from the main form disabled and focus the input in the user control so that pressing enter will trigger the default button from the panel. To emphasize the effect that only the RadWindow should be active you may also set its Modal property to true. For your convenience I created and attached a simple page illustrating the approach.

On a side note - can you reproduce this behavior when the asp panel is placed directly in the main form and not inside the RadWindow? On my end the behavior did not change and the ASP.NET's default button behavior remained the same in both cases. If the issue is reproducible this way then you will need to review your page settings since the problem does not originate in the RadWindow and is a general task.



Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
BrianS
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or