HI, I need to perform a multiplication as mentioned numeric controls, but this is outside the DataGrid. Please see inline image.
Hi Angelito,
We can do the multiplication using the Numeric Textbox component as in the below code snippet. We have done the Multiplication in the ValueChange Event of the component. Please refer to the below sample and documentation for more details.
|
@using Syncfusion.Blazor.Inputs
<P>Unit_Price</P> <SfNumericTextBox TValue="decimal?" @bind-Value="@Unit_Price" Width="250px"> <NumericTextBoxEvents TValue="decimal?" ValueChange="@ValueChangeHandler"></NumericTextBoxEvents> </SfNumericTextBox>
<P>Unit_Quantity</P> <SfNumericTextBox TValue="decimal?" @bind-Value="@Unit_Quantity" Width="250px"> <NumericTextBoxEvents TValue="decimal?" ValueChange="@ValueChangeHandler"></NumericTextBoxEvents> </SfNumericTextBox>
<p>Total</p> <SfNumericTextBox TValue="decimal?" Value="@Result" Width="250px"></SfNumericTextBox>
@code { public decimal? Result { get; set; }
public decimal? Unit_Price { get; set; }
public decimal? Unit_Quantity { get; set; }
public void ValueChangeHandler() { if (Unit_Price != null && Unit_Quantity != null) { Result = Unit_Price * Unit_Quantity; } } } |
Documentation : https://blazor.syncfusion.com/documentation/numeric-textbox/events#valuechange
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/NumericMultiPle-965702183
Kindly try the above suggestion and let us know if this meets your requirement.
Regards,
Udhaya Kumar D
Duraisamy, Thank you.
Hi Angelito,
We are happy to assist you. Please get back to us if you need any further assistance on this.
Regards,
Udhaya Kumar D
Hi Maam, How are you?
I want to simplify, instead of loop controls in PO Items, I want to use the sfGrid then pass on the primary key of the Purchase order to each row of PO Items. Is that possible? Please see attached inline-image for your reference.
Hi Angelito,
We have created a separate forum for the above query and shared the forum link below. Please follow the below forum for your new queries.
Forum Link : https://www.syncfusion.com/forums/176700/created-from-forum-176432-grid-queries
Regards,
Udhaya Kumar D