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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UnBound Column on GridGroupingControl and GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

29279 May 20,2005 06:33 PM UTC May 24,2005 03:37 PM UTC WinForms 5
loading
Tags: GridControl
Prof DISSOU Jamâl-Dine
Asked On May 20, 2005 06:33 PM UTC

Hi, I have 3 tables (eg. : Invoice Table with fields : InvoiceNo, ClientId. Client Table with fields : ClientId, ClientName. ClientCategory Table with fields : ClientCategoryId, ClientCategoryName. 1. How to display in GridGroupingControl with datasource is Invoice, the columns : InvoiceNo, ClientId, ClientName (Unbound Column from Client), ClientCategoryID (Unbound Column from ClientCategory), ClientCategoryName (Unbound Column from ClientCategory), so when the user enter a ClientId in the Invoice Table, the corresponding values (ClientName from Client, ClientCategoryID from ClientCategory, ClientCategoryName from ClientCategory) are displayed. 2. How to display in GridDataBoundGrid with datasource is Invoice, the columns : InvoiceNo, ClientId, ClientName (Unbound Column from Client), ClientCategoryID (Unbound Column from ClientCategory), ClientCategoryName (Unbound Column from ClientCategory), so when the user enter a ClientId in the Invoice Table, the corresponding values (ClientName from Client, ClientCategoryID from ClientCategory, ClientCategoryName from ClientCategory) are displayed. With best regards, Jamâl-Dine DISSOU

Administrator [Syncfusion]
Replied On May 21, 2005 12:28 AM UTC

These are foriegn key columns, aren''t they? If so, in both cases one solurion is to set the style.CellType of the column to be "ComboBox". Then set style.DataSource of the column to your foreign key table, set style.DisplayMember to teh DisplayMember columnname in the foreign key table, and set style.ValueMember to the ValueMember for the foreign key table. If you do not want to see the combobox button, then also set style.ShowButtons = Hide. Here is a link to a sample showing this for a GridDataBoundGrid. \Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\DataBound\GDBGcombos You can do the same type of thing for a GridGroupingControl. But if you want to sort by DisplayMember instead of valuememer, or group by the displayvalue, then you would have to use the techiques shown in this sample. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference. Here is another little sample. http://www.syncfusion.com/Support/user/uploads/GGC_ForeignKeyReference_a924c4a.zip If you want to do this with unbound columns, you can do so in either grid. In GridDataBondGrid, you would add a GridBoundColumn object for teh unbound column, and then populate this column in grid.Model.QueryCellInfo. In a GridGroupingContro, you would add an UnboundColumn, an dthen handle the QueryValue event to provide the values.

Prof DISSOU Jamâl-Dine
Replied On May 23, 2005 03:20 PM UTC

Since the Grid''s datasource is Invoice DataTable, and would like to display more columns than in the invoice datatable, I need to do something too. What ?

Administrator [Syncfusion]
Replied On May 23, 2005 04:06 PM UTC

In a GridDataBoundGrid (using GridBoundColumns), you can add several GridBoundColumsn with MappingName that do not appear in your DataTable. This will add enty columns to your grid. You then use grid.Model.QueryCellInfo to provide the values for these empty columns.

Prof DISSOU Jamâl-Dine
Replied On May 24, 2005 01:52 PM UTC

>In a GridDataBoundGrid (using GridBoundColumns), you can add several GridBoundColumsn with MappingName that do not appear in your DataTable. This will add enty columns to your grid. You then use grid.Model.QueryCellInfo to provide the values for these empty columns. What''s about GridGroupingControl ? Best regards, DISSOU Jamâl-Dine

Administrator [Syncfusion]
Replied On May 24, 2005 03:37 PM UTC

In a GridGroupingControl, you would add an UnboundColumn, and then handle the QueryValue event to provide the values. We ship several samples showing the use of QueryValue. Here is one. \3.2.1.0\Windows\Grid.Windows\Samples\Grouping\CustomSummary In the handler, you set e.Value based on the values passed in through the event args.

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

;