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

UnBound Column on GridGroupingControl and GridDataBoundGrid

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

5 Replies

AD Administrator Syncfusion Team May 20, 2005 07:28 PM

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.


PD Prof DISSOU Jamâl-Dine May 23, 2005 10:20 AM

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 ?


AD Administrator Syncfusion Team May 23, 2005 11:06 AM

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.


PD Prof DISSOU Jamâl-Dine May 24, 2005 08:52 AM

>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


AD Administrator Syncfusion Team May 24, 2005 10:37 AM

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.

Loader.
Live Chat Icon For mobile
Up arrow icon