0
#define.taskSelectAll(778)
element.task(#taskSelectAll);

If I have more than one grid, the task always selects the same griddata altough the focus is on another grid. Is there a way to set the focus?

Bullface
  • 39
  • 1
  • 9

2 Answers2

0

Have you tried using method FormDataSource.markRecord() to select required(/all) records?

10p
  • 5,488
  • 22
  • 30
  • I just want the data of the grid. This means that there could be multiple datasources on the grid. – Bullface Dec 10 '14 at 13:37
  • Each grid has a property named `DataSource`. E.g. it's set to *EmplTable*, and the grid displays 2 records. In this case call `EmplTable_ds.markRecord(RecId1, 1); EmplTable_ds.markRecord(RecId2, 1);` - it will select 2 records in the grid with property `DataSource` = *EmplTable*. – 10p Dec 10 '14 at 13:41
0

Set the grid's AutoDeclaration = Yes then call this code, replacing grid1 with your actual grid control:

#define.taskSelectAll(778)

element.selectControl(grid1);
element.task(#taskSelectAll);

OR if you don't want to set the AutoDeclaration = Yes and avoid the added overhead, you can do this:

#define.taskSelectAll(778)

element.selectControl(element.control(element.controlId('Grid1')));
element.task(#taskSelectAll);
Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71