The Grid is bound to an Entity:
(DocumentListQuestionId, DocumentListId, DocumentQuestionId, SequenceNumber, RuleHeaderId, ColumnNumber, ParentDocumentListQuestionId, QuestionHint, MapTable, MapField, MapTableType, DataFormat, QuestionValidationTypeId)
The Column "MapTable" is a varchar and is bound to a TypedView which is a list of all tables in the database (this does not need to be filtered).
[SELECT TOP (100) PERCENT name, object_id, principal_id, schema_id, parent_object_id, type, type_desc, create_date, modify_date, is_ms_shipped,
is_published, is_schema_published, lob_data_space_id, filestream_data_space_id, max_column_id_used, lock_on_bulk_load, uses_ansi_nulls,
is_replicated, has_replication_filter, is_merge_published, is_sync_tran_subscribed, has_unchecked_assembly_data, text_in_row_limit,
large_value_types_out_of_row
FROM sys.tables
ORDER BY name]
The column "MapField" is bound to a different TypedView which contains all of the fields in the database as well as a column for the table to which it belongs.
[SELECT TOP (100) PERCENT OBJECT_NAME(c.id) AS table_name, c.name, t.name AS data_type, c.isnullable, com.text AS default_text, c.length,
c.prec AS numeric_precision, c.scale AS numeric_scale, c.colorder
FROM sys.syscolumns AS c LEFT OUTER JOIN
sys.systypes AS t ON c.type = t.type AND c.xtype = t.xtype LEFT OUTER JOIN
sys.syscomments AS com ON com.id = c.cdefault
ORDER BY table_name, c.name, c.colorder]
After the user selects a table name (MapTable), I want to filter the MapField to only the fields for that table (for this row of the Grid). If no table is selected then no fields show up. I am only concerned about the current row and will not "limit to list" all of the rows.
The sql for the filter will thus look like this:
Where table_name = 'MyTableName'
or
Dim filter As IPredicate = (VwTablePropertiesFields.TableName = sTable)
as a predicate.
Thanks