I\'m wondering so when I change state of CheckBox
CheckBox->Checked=false;
It calls CheckBoxOnClick Event , how to avoid it ?
Some other and much easier solution is not avoiding the the OnClick event but modifying the event handler not to respond unless the DataSet.State is in either dsEdit or dsInsert as initiated by a user triggered TDBCheckBox click e.g.:
procedure TForm1.chkSelectClick(Sender: TObject);
begin
if chkSelect.Checked = True then
if DataSource1.DataSet.State in [dsEdit,dsInsert] then
begin
{ your event handler }
end;
end;