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
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
June 20, 2005 02:46 PM UTC
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 06:08 PM UTC
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 07:08 PM UTC
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 07:50 PM UTC
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 08:38 PM UTC
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.
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
LM Lan Mo
- Jun 20, 2005 02:10 PM UTC
- Jun 21, 2005 08:38 PM UTC