I have a Grid with a DBTableView. If my dataset query doesn't return anything I would like to show an empty row in my DBTableView (not the NewItemRow, but an empty row). How can I do this?
You can explicitly add a new record to the View's underlying dataset if it's empty. Try to implement the Grid's OnEnter event handler in a similar manner to what is shown below. Hopefully, this will do what you need and it shouldn't be a problem to adapt it.
procedure <Form>.<cxGrid>Enter(Sender: TObject);
var
View: TcxGridDBTableView;
begin
View := TcxGridDBTableView((Sender as TcxGrid).FocusedView);
if View.DataController.DataSet.IsEmpty then
begin
View.DataController.DataSet.Append;
View.Controller.EditingController.ShowEdit;
end;
end;