The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hello,
I have a master-detail grid form. In the detail grid, there are two columns, QtyPer and UnitQty. The product of these values is QtyReq. Here''s what I would like to do:
Whenever the user changes the values of QtyPer or UnitQty, I''d like to recalculate the value of QtyReq and refresh it in its cell. How do I do this?
Thank you.
ADAdministrator Syncfusion Team April 4, 2005 07:51 PM UTC
Is QtyReq an Expression column in your DataTable? That would be the simplest way to do it.
Otherwise, you could try handling an event like CurrentCellAcceptedChanges and if grid.Currentcell.ColIndex points to one of the first two columns, reset the value in the QtyReq column.
HEHelmutApril 6, 2005 01:08 PM UTC
I''m not sure how to set an expression column. However, what is the syntax to set the value of the QtyReq cell of the current row? Thank you.
>Is QtyReq an Expression column in your DataTable? That would be the simplest way to do it.
>
>Otherwise, you could try handling an event like CurrentCellAcceptedChanges and if grid.Currentcell.ColIndex points to one of the first two columns, reset the value in the QtyReq column.
ADAdministrator Syncfusion Team April 6, 2005 02:02 PM UTC
One way to do it is to use the CurrencyManager to access the underlying DataRowView and set the value there.
CurrencyManager cm = (CurrencyManager)grid.BindingContext[grid.DataSource, grid.DataMember];
DataView dv = (DataView) cm.List;
DataRowView drv = (DataRowView) cm.Current;
drv["Qty"] = ????
But if you want to use an expression column, here is a sample.
http://www.syncfusion.com/Support/user/uploads/GDBG_masterdetails_9a42cfe0.zip