AdvGrid - datasource connection, combobox filters

hello, i have 3 questions about AdvGrid component

1.How to connect AdvGrid with the DataSource.DataSet component from the property of the AdvGrid control, not the code
now i do it like this (code)
AdvGrid-> DataSource = MyDataSource;
and it currently works

but if I want to set the DataSource property on AdvGrid and enter there e.g. MyDataSource I immediately get an error

I'll just mention that I keep my MyDataSource on other form than AdvGrid.

  1. When I close the form and want to enter it again, they immediately get an error. this is probably due to the fact that I am not closing / clearing DataSrouce. How to do it? no such method, eg AdvGrid-> DataSource-> Clear (); or something like that

  2. is it possible to filter records on AdvGrid using ComboBox

I suspect these questions concern TDBAdvGrid?
It should be possible to change the datasource at any time but it is important of course that it is a valid instance of a datasource. Please verify this.
I would need more detail about the open/close. Without any detail, it is hard to guess what is wrong.
For filtering data in the grid itself (and not via the dataset), set grid.PageMode = false and see all filtering capabilities in the grid from page 104

Yes it's TDBAdvGrid

about connection
I have two forms
Form1 and here I have TDBAdvGrid (name: AdvGrid1)
FormDB and here I have DataSource (name: DataSource1) I use to connect to DB

In Form1::FormShow I have code:
AdvGrid1->DataSource = FormDb->DataSource1;
and It's working fine and data showing on the grid
but when I close the form1 and open it again I got error: Project Proj_name raised exception class $C00000005 with message 'access violation at 0.0001234: read of address 0x0001234'

about filtering
on Form1 I have AdvGrid (AdvGrid1) and ComboBox1
I have a "status" column on the AdvGrid1 and I would like it to work in such a way that changing the value in the ComboBox1 (event: OnChange) filters the grid by the status column.

Is the FormDB instance existing with an existing datasource at all times during your creation of form1?

For the filtering, there are 2 options

  1. dbgrid.PageMode = true -> you apply the filtering on the dataset and the dbgrid will reflect it
  2. dbgrid.PageMode = false -> you use dbgrid.Filter.Add and set the filter condition (filtering is explained from page 104 in

Is the FormDB instance existing with an existing datasource at all times during your creation of form1?


Then I cannot see a reason for this.
Please try to isolate this and send us a sample source project with which we can reproduce the problem here.