We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ggc column auto fill

Hello,

I have datatable("Price") with this columns:
Min Qty | Max Qty | Price
1 | 10 | 75
11 | 25 | 74
26 | 99 | 73
100| | 72
Blank Max Qty is unlimited

I have ggc with table "Item" and columns: "Name", "Qty", "Price", etc.
How to make the row("Price") automatic fill the correct price based on the "Price" table for particular Item when user add new record or edit existing "Qty"?

Thanks,
Harry


4 Replies

VK Vinoth Kumar K Syncfusion Team February 8, 2008 08:40 PM UTC

Hi Harry,

Thanks for using Syncfusion Products.

Issue : How to make the row("Price") automatic fill the correct price based on the "Price" table for particular Item when user add new record or edit existing "Qty"?

You can achieve this by using Expression Field in GridGroupingControl. Expression fields will allow you to add a column that holds calculated values based on the other fields in the same record.

Please refer to the browser sample in the following link:

C:\Documents and Settings\{User}\My Documents\Syncfusion\EssentialStudio\6.1.0.34\Windows\Grid.Grouping.Windows\Samples\2.0\FiltersAndExpressions\ExpressionField\CS

Please let me know if you have any questions.

Regards,
Vinoth






HA harisan February 9, 2008 07:01 AM UTC

Hello Vinoth,

Thanks for your assist. We
1. if we use expression field, we must add new column with name=expression field name to hold the result. Is it right?
efd=ExpressionFieldDescriptor("Amount", "[Qty]*[Price]", "System.Double")
ggc.Columns.Add("Amount")

I wish not to add columns("Amount"), and change code to: efd=ExpressionFieldDescriptor("Total", "[Qty]*[Price]", "System.Double")
column("Total") was bound to dataset, but it didn't work as expected.

2. How to set / retrieve value of particular cell in ggc.
e.g. If we click 'btn_Calculate', I expect to retrieve value from parenttable("Item").column("Qty") and ("Price") of current selected record to calculate amount.

It is also need to retrieve value from childtable("PurchaseDetail").columns("Cogs")
on row with latest date.
so we can calculate Profit.

How to do this perfectly in VB?

3. I wish to put combobox celltype with this code:
ggc.datasource=ds.tables("Item")
ggc.TableDescriptor.Columns("Brand").Appearance.AnyRecordFieldCell.CellType = "ComboBox"

I need to bind it to ds.tables("Item").columns("Brand") so that user can choose one available name or enter new one.

How to bind this combobox to the datasource?

Thanks and Best Regards,
Harry



HA harisan February 9, 2008 08:35 AM UTC

Hello Vinoth,

As for issue no. 3, I resolved by this code:
ggc.TableDescriptor.Columns("Brand").Appearance.AnyRecordFieldCell.DataSource = DS.Tables("Item")
ggc.TableDescriptor.Columns("Brand").Appearance.AnyRecordFieldCell.DisplayMember = "Brand"
ggc.TableDescriptor.Columns("Brand").Appearance.AnyRecordFieldCell.ValueMember = "Brand"

The problem is that: all same item showed, how to get distinctive value only showed in the dropdown item?

Thanks!
Harry




FS Fathima Shalini P Syncfusion Team February 11, 2008 12:16 PM UTC

Hi Harry,

Thank you for your patience.

Please find the simple sample, that removes the duplicate values in the combo box list of GridGrouping Control:

http://websamples.syncfusion.com/samples/Grid.Windows/71652/main.htm

Please let me know if any concerns.

Regards,
Fathima


Loader.
Live Chat Icon For mobile
Up arrow icon