Blazor | ComponentOne
Controls / Input Controls / Masked Text Box / Culture Settings
In This Topic
    Culture Settings
    In This Topic

    By default, Blazor formats and parses data using the current culture of the user's system. It allows you to set different masks for different cultures in the MaskedTextBox control. For example,you can set comma as the thousand separator mask character, a currency symbol, say "$", for currency mask character, etc.

    In the following example, we used date separator, thousand separator, and currency mask characters for showcasing different cultures.

    Showcasing culture settings in Masked TextBox

    This is how the output looks like after entering user input:

    Entering user input in MaskedTextBox control. 

    The following example shows how to set a culture-specific mask:

    Index.razor
    Copy Code
    <label>Mask using Date Separator mask character</label>
    <br />
    <C1MaskedTextBox Mask="00/00/0000"></C1MaskedTextBox>
    <br/>
    
    <br />
    <label>Mask using Thousands Separator mask character</label>
    <br />
    <C1MaskedTextBox Mask="00,000"></C1MaskedTextBox>
    <br/>
    
    <br />
    <label>Mask using Currency mask character</label>
    <br/>
    <C1MaskedTextBox Mask="$00000"></C1MaskedTextBox>
    <br/>
    
    @code {
    }