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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ggc column auto fill

Thread ID:

Created:

Updated:

Platform:

Replies:

71652 Feb 8,2008 11:23 AM UTC Feb 11,2008 12:16 PM UTC Windows Forms 4
loading
Tags: GridControl
harisan
Asked On February 8, 2008 11:23 AM UTC

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


Vinoth Kumar K [Syncfusion]
Replied On 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





harisan
Replied On 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


harisan
Replied On 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



Fathima Shalini P [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;