ASPxButton.AllowFocus Property
Gets or sets a value specifying whether the button can receive focus.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v18.2.dll
Declaration
[DefaultValue(true)]
public bool AllowFocus { get; set; }
<DefaultValue(True)>
Public Property AllowFocus As Boolean
Property Value
Type |
Default |
Description |
Boolean |
**true** |
true, if the button can receive focus; otherwise, false.
|
Use the ASPxButton.FocusRectBorder property to get access to the focus rectangle’s settings which define the width, style, and color.
Example
The complete sample project is available in the DevExpress Code Central database at E143.
function OnExpandCollapseButtonClick(s, e) {
var isVisible = ContentPanel.GetClientVisible();
s.SetText(isVisible ? "+" : "-");
ContentPanel.SetClientVisible(!isVisible);
}
...
<dxe:ASPxButton ID="btnShowHide" runat="server"
Text="Show / Hide" AllowFocus="False" AutoPostBack="False">
<ClientSideEvents Click="function(s, e)
{ RoundPanel.SetClientVisible(!RoundPanel.GetClientVisible()); }" />
</dxe:ASPxButton>
<br/>
<dxrp:ASPxRoundPanel ID="rpRoundPanel" runat="server" Width="200px"
ClientInstanceName="RoundPanel" HorizontalAlign="Justify">
<HeaderTemplate>
<table cellpadding="0" cellspacing="0">
<tr>
<td style="white-space: nowrap;">
Collapsible Round Panel
</td>
<td style="width: 1%; padding-left: 5px;">
<dxe:ASPxButton ID="btnExpandCollapse" runat="server" Text="-"
AllowFocus="False" AutoPostBack="False" Width="20px">
<Paddings Padding="1px" />
<FocusRectPaddings Padding="0" />
<ClientSideEvents Click="OnExpandCollapseButtonClick" />
</dxe:ASPxButton>
</td>
</tr>
</table>
</HeaderTemplate>
<PanelCollection>
<dxp:PanelContent runat="server">
<dxp:ASPxPanel ID="pnlContent" runat="server" Width="100%"
ClientInstanceName="ContentPanel">
<PanelCollection>
<dxp:PanelContent runat="server">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Morbi vel ante congue ligula
blandit rhoncus. Mauris tellus augue, viverra euismod,
facilisis at, vestibulum sed, risus.
Vivamus lobortis ultricies erat.
</dxp:PanelContent>
</PanelCollection>
</dxp:ASPxPanel>
</dxp:PanelContent>
</PanelCollection>
</dxrp:ASPxRoundPanel>
...
See Also