BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Is there a way to globally set ShowSpinButton=false on numeric text box? There has never been a time I want this enabled and would prefer to enable it manually if needed instead of disable it always.
Hi Michael,
Based on the information you've provided; it appears that you would like to enable or disable the spin button property once in all available numerictextbox component in single page. Please confirm your requirement. Based on your confirmation we will validate and update the solution.
If we have
misunderstood your requirement, please provide us with more details, including
a video demonstration, so we can assist you further.
Regards,
Sureshkumar P
I want it disabled ALL the time by default on the entire site, and if I wish to enable it in a certain page then I can. But, I also should have been more specific as it is when I use it in a grid that I would like to avoid all the extra code that I have to include every time:
EditorSettings="@(new NumericEditCellParams() {Params = new Syncfusion.Blazor.Inputs.NumericTextBoxModel<object>(){ShowSpinButton=false}})"
I realize I can set that in a variable, I was just curious if there was any way to not have it default to on since I never use the steps anyways on any page (or very very rarely)
Hi Michael,
We suspect that you are expecting to switch the ShowClearButton dynamically. We would like to inform that it is impossible to switch the values dynamically. Instead we suggest you to use an flag variable and based on the ariable we can render an new set of NumericTextBox component. Kindly check the attached code snippet for your reference.
<button @onclick="@click">change</button> <SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315"> <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings> <GridColumns> <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" EditType="EditType.NumericEdit" Width="120"> <EditTemplate> @if (IsEnable) { <SfNumericTextBox TValue=" double?" ID="Freight" @bind-Value="@((context as Order).Freight)" ShowClearButton="true"> </SfNumericTextBox> } else { <SfNumericTextBox TValue=" double?" ID="Freight" @bind-Value="@((context as Order).Freight)" ShowClearButton="false"> </SfNumericTextBox> } </EditTemplate> </GridColumn> </GridColumns> </SfGrid>
@code{ public bool IsEnable { get; set; } = false; public void click() { @if (IsEnable) { IsEnable = false; } else { IsEnable = true; } } } |
Please let us know if you have any concerns.
Regards,
Monisha