5

I have a form with two grids. I have one table with rows where each row has a status of Yes or No. I'd like to display all the yes's in the top and the no's in the bottom grid.

A similar scenario would be if I wanted to show SalesTable header records. The top grid would be only those with a status of Delivered, and the bottom grid those with a status of Invoiced.

How can I accomplish this?

I've gotten close by adding another datasource of the same table type. I add a QueryBuildRange to filter the records but I get two issues:

  1. When I click on a row in the top/bottom, it moves both row lines at the same time (the highlighting thing
  2. It wants to show an equal number of top rows as bottom rows for some reason?? If I have 3 delivered sales orders, and 5 invoiced sales orders, it will show 3 in the top and 3 in the bottom.
Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71

1 Answers1

5

Seams like the Grid-controls are being controlled by the same DataSource.
Check the properties of the Grid-control: make sure they are not set to the same DataSource!

Anyway, it would be helpful to know how the Form is structured and how the QueryBuildRange was added.

I created a very simple Form and it worked correctly:

  • added two Datasets with T-SalesTable each
  • added two Grid-controls to the Design (or to a TabPage, both worked)
  • adjusted the DataSource-property of each Grid to point to each DataSource
  • added fields (the AutoReport group) from the corresponding DataSource to each Grid

this one worked correctly (despite having the same contents. Then I

  • added a range in the init method of each of the Datasets

and it still worked.

enter image description here

user85421
  • 28,957
  • 10
  • 64
  • 87
  • AH! You are brilliant! It was the grid's datasource. I dragged/dropped fields on a newly built grid from the second datasource and just assumed it would get those first. How frustrating. – Alex Kwitny Nov 22 '11 at 15:44