DxSpinEdit<T>.InputId Property

Specifies a unique identifier (ID) of the Spin Edit’s input element.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public string InputId { get; set; }

Property Value

Type Description
String

A unique identifier.

Remarks

The InputId property value is assigned to the id attribute of the Spin Edit’s input element. The id is case-sensitive, should contain at least one character, and should not contain whitespaces (spaces, tabs, etc.)

When you create a Form Layout component and add a Spin Edit to a layout item’s template, use the InputId property to associate the Spin Edit with the layout item’s caption.

  • Specify the layout item’s Caption property. A browser renders the caption as an HTML label element.
  • Set the layout item’s CaptionFor property to a unique value. This value is assigned to the label’s for attribute.
  • Set the editor’s InputId property to the same value as the item’s CaptionFor.
NOTE

If you do not specify the CaptionFor property, the Form Layout generates a random identifier (GUID) and assigns it to the label’s for attribute and to the id property of the first input element in the template.

<DxFormLayout>
   @*...*@
   <DxFormLayoutItem Caption="Years Worked:" CaptionFor="spin_edit">
       <Template>
           <DxSpinEdit @bind-Value="@YearsWorked" InputId="spin_edit"></DxSpinEdit>
       </Template>
   </DxFormLayoutItem>
</DxFormLayout>

@code {
    // ...
    int YearsWorked { get; set; } = 3;

}

You can click the associated label to focus/activate the Spin Edit input.

Data Editor and Layout Item Caption

See Also