Master Detail form DataGridView combobox lookup Problem
hi
i have a master detail form with databound datagridviews.
my detail datagridview is bound to FKFieldSubFieldLookupTableBindingSource
and it shows the linked sub-fields when the main field changes.
This datagrid has only one column which is the sub-field names column. this column type is ComboBox.
here are this combobox details
DataSource = subFieldLookupBindingSource
DisplayMember = sub_field_name
value Member = sub_field_id
No Problem until here.
When i click on the Cell combobox I get the list of all the sub-fields. I don't want this. because once a sub-field has been associated with a Master field, it should not be available for other Master fields.
What i did was, In the SubFieldLookup Dataset, i added a query to get all those sub-fields which haven't been associated yet.
but this clears up the detail datagrid and shows blank comboboxes where it is supposed to have the sub-fields.
How do I solve this issue.
I simplly want the master-detail mechanism to work and when i want to add a new sub-field, and click the combobox in sub-fields datagrid, i want to have only those sub-fields which are marked False in database in the column 'alreadyAssociated'
Please Help
Re: Master Detail form DataGridView combobox lookup Problem
You can't bind the column. You need to populate each ComboBox control individually on demand. You should look at the EditingControlShowing event, which is raised each time the user starts editing a cell.
Re: Master Detail form DataGridView combobox lookup Problem
That did the job bang on...
Thank a trillion dude, main reason why i love this forum :-)