Maria,
This is tricky but it is do-able. Basically you need to add a
combo box to your form and make it invisible. To add over the current cell
do the following, I dont have full code for you but this should help.
Rectangle rect;
rect = dataGrid1.GetCurrentCellBounds();
comboBox1.Width = rect.Width;
comboBox1.Height = rect.Height;
comboBox1.Left = rect.Left + dataGrid1.Left;
comboBox1.Top = rect.Top + dataGrid1.Top;
comboBox1.Visible = true;
What you then need to do is to update the current cell when the values are
changed in the comboBox. This also needs to be tied into the paint even for
the form because you need to detect which column needs the combo box. And
when shifting from one that does to one that doesent you need to make sure
you repaint to get updated values etc.
Regards - OHM
Maria wrote:
> When adding records through a datagrid I would like one
> of the fields only to accept the values 'Yes' or 'No' is
> it possible to set this field to some kind of combobox or
> list. The datatype for the field in the database is set
> to Yes/No and I thought that this may have been directly
> translated after binding had taken place but this was not
> the case
(
>
> what I ultimately want to do is place a filter on the
> records shown in the datagrid based on the result of this
> field
>
> I normally develop apps of this nature in Access and have
> lost my way here a bit how can I achieve this effect
>
> Maria
Regards - OHM#
(E-Mail Removed)