Perform Multiplication between two NumericTB (qty*up)outside DataGrid

HI, I need to perform a multiplication as mentioned numeric controls, but this is outside the DataGrid. Please see inline image.






5 Replies 1 reply marked as answer

UD UdhayaKumar Duraisamy Syncfusion Team July 26, 2022 06:21 AM UTC

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




AN Angelito July 26, 2022 04:24 PM UTC

Duraisamy, Thank you.



UD UdhayaKumar Duraisamy Syncfusion Team July 27, 2022 05:09 AM UTC

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




AN Angelito replied to UdhayaKumar Duraisamy August 6, 2022 11:50 AM UTC

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.





UD UdhayaKumar Duraisamy Syncfusion Team August 8, 2022 08:13 AM UTC

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



Marked as answer
Loader.
Up arrow icon