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

combobox grid pickup list

in GGC, I have a column called "Super Section" which is a combobox pick up list. when user click the dropdown list, it will display a grid with "Section Id","On Street", "From Street", "End Street" columns that comes from a section table. When a section is selected, it will return the "Section ID" to the "Super Section" cell value. Any similar examples? Thanks, Lan

5 Replies

AD Administrator Syncfusion Team June 20, 2005 09:46 AM

Take a look at this sample. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference Also, there is also a sample in this forum thread. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference


LM Lan Mo June 21, 2005 01:08 PM

I add following code, but no drop-down arrow displaying in the cell for the foreign-key grid. I don''t know why? Any idea? DataSet dsTmp=BL.Access.LoadDataSet(lookup_table,null,where); DataTable tbLookup=dsTmp.Tables[lookup_table]; string sLookup=ColumnName+"_Lookup"; gdBase.Engine.SourceListSet.Add(sLookup,tbLookup); GridTableDescriptor mainTd = this.gdBase.TableDescriptor; gdBase.TableOptions.AllowDropDownCell=true; GridRelationDescriptor rdSSect_NO = new GridRelationDescriptor(); rdSSect_NO.Name = "SuperID"; rdSSect_NO.RelationKind = RelationKind.ForeignKeyReference; rdSSect_NO.ChildTableName = sLookup; // SourceListSet name for lookup rdSSect_NO.RelationKeys.Add(ColumnName, lookup_field_code); rdSSect_NO.ChildTableDescriptor.Appearance.AlternateRecordFieldCell.BackColor = Color.Beige; rdSSect_NO.ChildTableDescriptor.VisibleColumns.Add(lookup_field_code); rdSSect_NO.ChildTableDescriptor.VisibleColumns.Add("loc_street"); rdSSect_NO.ChildTableDescriptor.VisibleColumns.Add("loc_from"); rdSSect_NO.ChildTableDescriptor.VisibleColumns.Add("loc_to"); rdSSect_NO.ChildTableDescriptor.SortedColumns.Add("loc_street"); rdSSect_NO.ChildTableDescriptor.AllowEdit = false; rdSSect_NO.ChildTableDescriptor.AllowNew = false; // Make pencil icon disappear, users can''t modify states. mainTd.Relations.Add(rdSSect_NO); >Take a look at this sample. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference > >Also, there is also a sample in this forum thread. > >\Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\Grouping\ForeignKeyReference


AD Administrator Syncfusion Team June 21, 2005 02:08 PM

Is ColumnName the mappingname of the column where you want the dropdown in the grid? Are you seeing any exceptions listed in your output window? Here is another sample. http://www.syncfusion.com/Support/user/uploads/GGC_ForeignKeyReference_a924c4a.zip If you can upload a sample that shows the problem, we can try to spot it here.


LM Lan Mo June 21, 2005 02:50 PM

Here are my grid form files. It is generic data edit form. You can''t run it. the code is in SetColumn(...) >Is ColumnName the mappingname of the column where you want the dropdown in the grid? > >Are you seeing any exceptions listed in your output window? > >Here is another sample. http://www.syncfusion.com/Support/user/uploads/GGC_ForeignKeyReference_a924c4a.zip > >If you can upload a sample that shows the problem, we can try to spot it here. frmGrid_7817.zip


AD Administrator Syncfusion Team June 21, 2005 03:38 PM

I suspect there is some naming problem. Add debug code to your program to loop through and print out: 1) all the ColumnNames for both the main datatable and the lookup datatable. 2) all the tableDescriptor.Columns[index].MappingNames for both the main tabledescriptor and the relation.tabledescriptor. Then verify the name you are using as exactly the names shown in the debug printout and what you expect. If you can upload a working prgram, we can try to do this here.

Loader.
Live Chat Icon For mobile
Up arrow icon