Skip to main content
All docs
V17.2

How to: Avoid focus losing and insert tab as text symbol on tab key pressing

  • 2 minutes to read

This example demonstrates how to avoid ASPxMemo standard behavior on a tab key press. By default, pressing the tab key switches focus from the current element to the next one. If you need to insert a tabulation symbol into your ASPxMemo, it is necessary to detect key code in the client-side KeyDown event and prevent focus from being lost by using the ASPxClientUtils.PreventEvent method.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}